Modules Encoding

Posted by Community Admin on 05-Aug-2018 11:56

Modules Encoding

All Replies

Posted by Community Admin on 21-Mar-2011 00:00

Hello,

I'm encountering a double UTF-8 encoding problem in the sitefinity modules I make.

Here is what i do :
- Create an empty module
- In the "ItemSubmitTemplate.ascx" view, I add a label with an accent in the "Text Property, as follows :

<asp:Label Text="Accentué" runat="server" ID="Label1" />

- I install and register the module in a sitefinity website (in which i don't have any problem with accentuated characters).
- In the website, the text displayed is the following : "Accentué"

While in the rest of the website, my "é" characters are well displayed, in any module, they are displayed as "é" (their utf-8 encoding).
I am wondering  if there is one too many utf-8 encoding somewhere?

Thank you,
F.

Posted by Community Admin on 28-Mar-2011 00:00

Hi F Lamari,

Apparently this is what happens. I tried with one of our custom modules by saving the .ascx file of the module using different encodings (UTF-8 with/without signature, Windows-1252) - always the accented letters come broken. This appears to be by design. For now we could suggest you to use HTML entity codes for accented letters - here is a table with most commonly used letters:

http://www.starr.net/is/type/htmlcodes.html

Best wishes,
Liubomir
the Telerik team

Posted by Community Admin on 29-Mar-2011 00:00

Thank you very much,

in the meantime, putting my texts in localized variables using a resource class seems to work fine.
My only problem is that my resource class seems not to be persistent (i wrote a post about it). It's registered as long as I stay in the same IIS process (if I reset IIS, my resource class is no longer registered, and can't be found).

F.

Posted by Community Admin on 29-Mar-2011 00:00

Hello ,

Where did you register the resource class? Did you register it on the Application_Start event? Could you send me a link to this post of yours describing your problem?

Kind regards,
Liubomir
the Telerik team

Posted by Community Admin on 29-Mar-2011 00:00

Hello,

thank you for your answer. I registered the Resource class in the "Initialize" method of the module.

Here is a link to my post : http://www.sitefinity.com/devnet/forums/sitefinity-4-x/sdk/resources-problem-with-the-jobs-intermediate-sample.aspx

F.

Posted by Community Admin on 29-Mar-2011 00:00

Hi ,

I see. I'm not sure if the Initialize method of the module fires on every application restart or just when you install the module for the first time, but it appears that it's fired only one time. This is why I believe it is more convenient to register this in the Application_Start event.


All the best,
Liubomir
the Telerik team

Posted by Community Admin on 29-Mar-2011 00:00

Thank you,

I saw a sample as to how to put the registration of the resources and settings class in the Application_Start in the global.asax on another thread of this forum.
It works well now.

Thank you,
F.

This thread is closed