Umbraco 14 : Rich Text Editor displaying unicode characters
Update : changing from IContent to IPublishedContent seems to solve this issue. I don't really get the difference and when to use one or another...
Hi everyone,
First of all, this is my first time ever posting on a forum because I'm new to development (started in January). Please excuse my lack of experience and if my request may seems dumb. Plus, excuse my grammar/vocabulary errors, I'm French...
So, I have a problem when I try to display the content of my Rich text Editor. It renders unicodes and HTML tags. I solved the HTML tags' problem by using a Regex. But I don't know what to use for unicodes.
For example :
Text editor contains : Retour en photo du Workshop consacré aux retours d’expériences
What is rendered : {"markup":"\u003Cp\u003ERetour en photo du Workshop consacr\u00E9 aux retours d\u2019exp\u00E9riences
Some context elements; I identify my Document with:
PLEASE : comment with details and a maximum of explanations because, I repeat, I am a newbie...
Thank you in advance and feel free to reach me for further informations.
Thanks for your message, I will try it. For the moment, changing for a IPublishedContent and looking for Value("content") seems to display the content as expected. Thanks again, have a nice day !
Firstly, welcome to Our and the Umbraco community :-)
I wanted to address your additional query around IContent and IPublishedContent.
The simple rule of thumb is that IContent is what is used by the Umbraco back office and customisations that integrate with that part of the system to update content data. Where as IPublishedContent is what should be being used on the front end of the site, in your Razor Views etc.
IContent and IMedia represents the raw values of content and media and are accessed via the ContentService and MediaService respectively. These access data via the database directly.
IPublishedContent represents both Content and Media, and they come from the Published Content Cache (currently NuCache). They are much more performant when querying and rendering out data but they are essentially read-only versions of the currently published data. They also take advantage of Property Value Converters that convert database stored data into more render/user friendly data for the front end - and example of this is the MultiNodeTreePicker property editor. In the database this stores the UDI's of the picked content, however the Property Value Converter will convert it to a list of IPublishedContent.
Hopefully that helps with your understanding of when you should find yourself using each type? If you have more questions, feel free to ask.
Thank you so much for your kindness through this detailed message. Every explanation is so much appreciated and made some things more easy to understand and use in code.
I will definitely deeper for every term you have used because I am not really familiar with every single ones... But things are clearer now, thank you so much for that.
Have a nice day, and again, thanks for the kindness in your explanations and the time you took to write those down.
Umbraco 14 : Rich Text Editor displaying unicode characters
Update : changing from IContent to IPublishedContent seems to solve this issue. I don't really get the difference and when to use one or another...
Hi everyone,
First of all, this is my first time ever posting on a forum because I'm new to development (started in January). Please excuse my lack of experience and if my request may seems dumb. Plus, excuse my grammar/vocabulary errors, I'm French...
So, I have a problem when I try to display the content of my Rich text Editor. It renders unicodes and HTML tags. I solved the HTML tags' problem by using a Regex. But I don't know what to use for unicodes.
For example :
Retour en photo du Workshop consacré aux retours d’expériences
{"markup":"\u003Cp\u003ERetour en photo du Workshop consacr\u00E9 aux retours d\u2019exp\u00E9riences
Some context elements; I identify my Document with:
I display it with:
PLEASE : comment with details and a maximum of explanations because, I repeat, I am a newbie... Thank you in advance and feel free to reach me for further informations.
I think it encoder issues
in Startup.cs under ConfigureServices or before services.AddUmbraco or in Composer add
Thanks for your message, I will try it. For the moment, changing for a IPublishedContent and looking for Value("content") seems to display the content as expected. Thanks again, have a nice day !
Please don't do this
Startup.cs
modification, this is not the problem! 😅 Instead, Nik has explained the problem nicely.Hi Jessica,
Firstly, welcome to Our and the Umbraco community :-)
I wanted to address your additional query around
IContent
andIPublishedContent
.The simple rule of thumb is that
IContent
is what is used by the Umbraco back office and customisations that integrate with that part of the system to update content data. Where asIPublishedContent
is what should be being used on the front end of the site, in your Razor Views etc.IContent
andIMedia
represents the raw values of content and media and are accessed via theContentService
andMediaService
respectively. These access data via the database directly.IPublishedContent
represents both Content and Media, and they come from the Published Content Cache (currently NuCache). They are much more performant when querying and rendering out data but they are essentially read-only versions of the currently published data. They also take advantage of Property Value Converters that convert database stored data into more render/user friendly data for the front end - and example of this is the MultiNodeTreePicker property editor. In the database this stores the UDI's of the picked content, however the Property Value Converter will convert it to a list ofIPublishedContent
.Hopefully that helps with your understanding of when you should find yourself using each type? If you have more questions, feel free to ask.
Thanks
Nik
Hey Nik,
Thank you so much for your kindness through this detailed message. Every explanation is so much appreciated and made some things more easy to understand and use in code.
I will definitely deeper for every term you have used because I am not really familiar with every single ones... But things are clearer now, thank you so much for that.
Have a nice day, and again, thanks for the kindness in your explanations and the time you took to write those down.
Jessica
is working on a reply...