Encoding of Urls in Radeditor WCM

18 posts, 0 answers
  1. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 15 Oct 2012 Link to this post

    Hi Telerik.

    I have a standard Sharepoint 2010 environment using Telerik Radeditor WCM v 6.1.7.0.

    1) Open hyperlink manager and create an anchor HøHø
    2) Create a hyperlink using hyperlink manager and use the "Existing Anchor" dropdown and select HøHø.
    3) Publish the page and the anchor link does not work.

    It seems as if the anchor-link is encoded to the utf-8 version <a href="#H%c3%b8H%c3%b8">, but the anchor itself remains like <a name="HøHø". As effect, the hyperlink is not working in IE but works fine in Firefox.    

    In the ConfigFile.xml I have ContentFilters=ConvertToXhtml, ConvertCharactersToEntities

    Before the content is published, the anchor and the link is written with html entities as H&oslash; In RadEditorGetStorageHtml in SPEditorTools.js the value of editor.get_html(true) is also the correct using html entities.

    Please advice.

    Best regards
    Klaus
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 17 Oct 2012 Link to this post

    Hi Klaus,

    Can you please provide the HTML which works on your end and I will help you to produce such HTML with RadEditor? Right now neither HøHø nor H%c3%b8H%c3%b8 or H&oslash; work in a standard HTML page on my end in IE.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

  3. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 17 Oct 2012 Link to this post

    Hi Rumen,
    thank you for following up.

    Plain html like this works on my IE9.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head>
        <title>Untitled Page</title>
    </head>
    <body>
    <a href="#HøHø">A Link</a>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    Jump to here
    <a id="HøHø"></a>
    </body>
    </html>

  4. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 17 Oct 2012 Link to this post

    Hi Rumen,

    thanks for getting back.
    The following plain html works on my IE9.

    <a href="#HøHø">A Link</a>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    Jump to here
    <a id="HøHø"></a>
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 17 Oct 2012 Link to this post

    Hello,

    I was able to fix the issue by disabling the ContentFilters of RadEditor, e.g.

    \Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\6.5.0.0__1f131a624888eeed\Resources\ConfigFile.xml

    <property name="ContentFilters">None</property>

    For your convenience I recorded a video demonstrating my test: http://screencast.com/t/oTF2ppY60y.

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 18 Oct 2012 Link to this post

    Hi Rumen.

    I can't seem to get it to work.

    Before publish, the markup in html view looks ok. Like this:

    <a href="#HøHø">A Link</a>
     
    Jump to here
     
    <a id="HøHø"></a>


    After publish the markup is changed to this:

    <a href="#H%c3%b8H%c3%b8">A Link</a>
     
    Jump to here
     
    <a id="HøHø"></a>



    My ConfigFile.xml

    <configuration>
      <property name="ContentAreaMode">Iframe</property>
      <property name="ContentFilters">None</property>
      <property name="DocumentsFilters">
        <item>*.*</item>
      </property>
      <property name="AllowScripts">true</property>
      <property name="NewLineBr">False</property>
      <property name="ToolbarMode">Floating</property>
      <property name="ToolbarMode">ShowOnFocus</property>
      <property name="ToolsWidth">570px</property>
      <property name="Skin">Telerik</property>
      <property name="Width">100%</property>
      <property name="Height">700px</property>
      <property name="MaxImageSize">524288</property>
      <property name="ImagesPaths">
        <item>/SiteCollectionImages</item>
        <item>PublishingImages</item>
        <item>Konverterede billeder</item>
      </property>
      <property name="DocumentsPaths">
        <item>Filer</item>
        <item>Sider</item>
      </property>
      <property name="FlashPaths">
        <item>/SiteCollectionImages</item>
      </property>
    </configuration>


    I use version 6.1.7.0 with Danish language pack installed.

    Please advice.

    - Klaus
  7. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 22 Oct 2012 Link to this post

    Hi Rumen,

    were you able to reproduce my case?

    Best regards

    - Klaus
  8. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 23 Oct 2012 Link to this post

    Hi Klaus,

    My suggestion is to upgrade to the latest build 6.5.0 of RadEditor for SharePoint 2010 and configure the editor as shown in the video provided in my earlier post (http://screencast.com/t/oTF2ppY60y).

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  9. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 23 Oct 2012 Link to this post

    Hi Rumen.

    I have downloaded and installed latest release as you suggested. However, the problem still persist.

    But I have found out something else. The problem does not exist when the Radeditor webpart is manually inserted on a publishing page. The problem only exists with the richhtmlfields where Radeditor is used as editor.

    Can you reproduce that behavior?

    Best regards

    - Klaus
  10. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 23 Oct 2012 Link to this post

    Hi,

    Can you please replace RadEditor with the built-in SharePoint editor and see whether the same behavior occurs in it? If the problem is reproducible this means that the content is encoded by the SharePoint content filters which cannot be disabled.

    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 23 Oct 2012 Link to this post

    Hi Rumen,

    thank you for fast reply :-)

    I already tried that, and the built-in editor does not have the same problem.

    - Klaus
  12. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 26 Oct 2012 Link to this post

    Hello,

    I found that the problem happens in non IE browsers.

    You should do the following to solve this browser behavior:
    1) To stop the conversion of ø to entity disable the ConvertCharactersToEntities filter by opening the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\6.5.0.0__1f131a624888eeed\Resources\ConfigFile.xml file and setting the ContentFilters property by skipping the ConvertCharactersToEntities filter:

    <property name="ContentFilters">RemoveScripts,EncodeScripts,MakeUrlsAbsolute,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,OptimizeSpans,ConvertToXhtml,IndentHTMLContent</property>

    2) The next step is to implement a custom content filter which will replace the %C3%B8 url encoded character to ø character. This will fix the issue in the non IE browsers.

    You can see this article for more information about the custom content filters: Converting Unicode symbols to numeric HTML entities using a content filter. See this article to learn how to register the filter in SharePoint environment: How to execute custom code called on RadEditor's events.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. Klaus
    Klaus avatar
    2 posts
    Member since:
    Mar 2010

    Posted 29 Oct 2012 Link to this post

    Hi Rumen.

    I have the problem in IE as well.

    I have tried out your approach, and can see that it will work for new content. However, I am puzzled that this is really something that we must implement ourselves. Is this not standard functionality, since a lot of NON-US users with have this problem? Please confirm that this is not something that is suppose to work OOTB with Sharepoint 2010.

    Another thing. Your suggestion works fine on fresh content that is just created, because the filter is applied. However, it doesn't solve the problem with already existing content. We have 50K+ pages in our recently upgraded sharepoint solution, and they may have this bookmark encoding error. The content is created with Radeditor in MOSS 2007, and now the problem is there in the upgraded Sharepoint 2010 solution. How do I fix this?

    Best regards

    Klaus
  14. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 01 Nov 2012 Link to this post

    Hello,

    You can attach to the OnClientLoad event of RadEditor and parse and modify the content directly once it is loaded in the content area and replace the %C3%B8 url encoded character to ø character.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  15. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 02 Nov 2012 Link to this post

    Hi Rumen.

    Yes, I have that part with onclientload up and running. But as far as I can see, it only affects content when in design or edit mode.

    My scenario is the following:

    1) MOSS 2007 site with +50K pages with content created with RadEditor.
    2) Upgraded to Sharepoint 2010
    3) All bookmarks in the +50K pages are not working because of this encoding issue.

    Editors can ofcourse edit the failing pages, and by using the onclientload workaround, the bookmarks will the be fixed. However, it is a huge task to edit all pages. Is this what you suggest?

    Best regards

    Klaus
  16. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 02 Nov 2012 Link to this post

    Hi,

    My idea was to replace the special symbols in the OnClientLoad event in addition to the custom content filter. This will ensure that if the user inserts special symbol they will be also converted when switching to HTML mode and when submitting the content.

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  17. Klaus
    Klaus avatar
    17 posts
    Member since:
    Mar 2010

    Posted 05 Nov 2012 Link to this post

    Hi Rumen.

    Thanks for your reply. As far as I can see, the onclientload is fired only when the page is in edit mode. This means that the thousands of pages that may contain wrongly encoded bookmarks need to be identified and manually put into edit mode and re-published in order to let the script kick in. Is this correct?

    Cheers
    Klaus
  18. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 08 Nov 2012 Link to this post

    Hello,

    Unfortunately this is correct. You can try creating some custom SharePoint solution, which will iterate through all the pages and do the job on the server. However we can not provide you with such.

    Regards,
    Stanimir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top