Character Encoding or HTML entities

Last post 03-25-2009, 2:05 PM by Adam. 4 replies.
Sort Posts: Previous Next
  •  03-16-2009, 5:00 PM 49966

    Character Encoding or HTML entities

    HTML Entities not reloading correctly in editor.
     
    Steps to reproduce:
    1) Copy text from a website including mdashes and curly quotes encoded as iso-8859-1 or UTF-8
    2) Paste into CuteEditor using normal paste option and save to db.
    3) When these contents are displayed from database onto a web page they look fine.
    4) When these contents are selected for editing and reloaded into CuteEditor the entities do not render correctly in the editor.
    5) If the form is saved, then when the contents are displayed again on webpage they do not render correctly anymore.

    Am I  doing something wrong?
     
    To rephrase for clarity.  If I paste in the editor and save then the entities display correctly. It is when I reload that text back into the editor that they are scrambled.
     
    Thanks for any advice.
  •  03-17-2009, 1:18 PM 49992 in reply to 49966

    Re: Character Encoding or HTML entities

    1. Which version of Cute Editor are you using?
     
    2. Can you reproduce this issue in the following example?
     
     
    3.  Have you set the following property to true?
     

    Editor.UseHTMLEntities Property

    By default Cute Editor maps most special characters to the equivalent HTML entity automatically. You can turn it off by setting this property to "false".

     


    Example Code

          <%
               Dim editor
               Set editor = New CuteEditor
               editor.ID = "Editor1"
               'By default Cute Editor maps most special characters to the equivalent HTML entity automatically. You can turn it off by setting this property to "false".
               editor.UseHTMLEntities = true
               editor.Text = "Hello World"
               editor.Draw()
          %>

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-17-2009, 4:23 PM 50001 in reply to 49992

    Re: Character Encoding or HTML entities

    Hi, I am using ASP v6.0
     
    Yes, I have tried with  editor.UseHTMLEntities = true
     
    I can't use this link to test because I can't save and reload.
     
     
    I am saving the editor contents as ntext (Variable-length Unicode data).  The contents save fine and display fine when read back out to display page but when loaded back into the editor then, for example, an mdash appears as ( — ).
     
    It appears that the doctype of the page has an influence.  I have made three working test pages. Simply paste some text containing entities to these forms and save them.

     
    If no doctype is specified everything seems to work fine. If I declare either unicode format then I get the behavior.  Interestingly I can paste japanese characters and they work fine in all the test pages.  So it looks like its just the entities.
     
    Hope that helps.
    Dave
     
     
     
  •  03-18-2009, 4:33 PM 50052 in reply to 50001

    Re: Character Encoding or HTML entities

     
    Original Text from
    http://www.economist.com/printedition/displayStory.cfm?story_id=13237193
     
    A HUNDRED years ago a group of foreign diplomats gathered in Shanghai for the first-ever international effort to ban trade in a narcotic drug. On February 26th 1909 they agreed to set up the International Opium Commission—just a few decades after Britain had fought a war with China to assert its right to peddle the stuff. Many other bans of mood-altering drugs have followed. In 1998 the UN General Assembly committed member countries to achieving a “drug-free world” and to “eliminating or significantly reducing” the production of opium, cocaine and cannabis by 2008.
     
     
  •  03-25-2009, 2:05 PM 50276 in reply to 50052

    Re: Character Encoding or HTML entities

     
    Please check this example. It saves the data and reload the data from database.
     
    Here is the original code:
     
    A HUNDRED years ago a group of foreign diplomats gathered in Shanghai for the first-ever international effort to ban trade in a narcotic drug. On February 26th 1909 they agreed to set up the International Opium Commission&mdash;just a few decades after Britain had fought a war with China to assert its right to peddle the stuff. Many other bans of mood-altering drugs have followed. In 1998 the UN General Assembly committed member countries to achieving a &ldquo;drug-free world&rdquo; and to &ldquo;eliminating or significantly reducing&rdquo; the production of opium, cocaine and cannabis by 2008.
     
    Here is the code in CuteEditor.
     
    A HUNDRED years ago a group of foreign diplomats gathered in Shanghai for the first-ever international effort to ban trade in a narcotic drug. On February 26th 1909 they agreed to set up the International Opium Commission&#8212;just a few decades after Britain had fought a war with China to assert its right to peddle the stuff. Many other bans of mood-altering drugs have followed. In 1998 the UN General Assembly committed member countries to achieving a &#8220;drug-free world&#8221; and to &#8220;eliminating or significantly reducing&#8221; the production of opium, cocaine and cannabis by 2008.
     

    1. The ogriginal code uses html entities.
     
    2. Cute Editor uses the html entities too.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML