+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Modules Encoding

Modules Encoding

7 posts, 0 answered
  1. F
    F avatar
    34 posts
    Registered:
    15 Mar 2011
    21 Mar 2011
    Link to this post

    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.
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    28 Mar 2011
    Link to this post
    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
  3. F
    F avatar
    34 posts
    Registered:
    15 Mar 2011
    29 Mar 2011
    Link to this post
    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.
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    29 Mar 2011
    Link to this post
    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
  5. F
    F avatar
    34 posts
    Registered:
    15 Mar 2011
    29 Mar 2011
    Link to this post
    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.
  6. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    29 Mar 2011
    Link to this post
    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
  7. F
    F avatar
    34 posts
    Registered:
    15 Mar 2011
    29 Mar 2011
    Link to this post
    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.
7 posts, 0 answered