Corrupted text when pulling from DB

Last post 01-02-2009, 1:24 PM by Adam. 5 replies.
Sort Posts: Previous Next
  •  01-01-2009, 3:46 PM 47345

    Corrupted text when pulling from DB

    Well here goes...
     
    I recently purchased the Classic ASP Cute Editor. This product works great and was easy to install, however I am having a major problem when the editor grabs text that is stored in the database.
     
    Here is my situation.
     
    ----------------------------------
     
    Step 1: User creates a new article in the editor and then saves the article. The article is then stored into the DB correctly.
     
    Step 2: When a user wants to edit the article, the article is then pulled into the editor and this is where the issue happens. All of the curly brackets and what not are replaced with weird symbols. I believe there is an issue with the fact that our site is in UTF-8 and the data being pulled is in ISO-? (Microsoft default ISO).
     
     
    ----------------------------------
     
    In order to troubleshoot I used the demo on your website. The difference between the demo on the Website and my editor is that when you paste text and say clean Word formatting, etc. The text still contains curly or smart quotes and symbols. Where as on the Demo on your site, when I paste, the smart symbols are replaced with basic symbols
     
    If anyone could help me ASAP I am trying to launch a website and this is the only thing that is holding me back!
     
    Sincerely,
     
    Mathieu
  •  01-02-2009, 12:21 PM 47354 in reply to 47345

    Re: Corrupted text when pulling from DB

    Mathieu,
     
    In the download package, you can find the following example:

    http://cutesoft.net/asp/todatabase.asp
     
    Please check it and compare it with your own code.

    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

  •  01-02-2009, 12:28 PM 47355 in reply to 47354

    Re: Corrupted text when pulling from DB

    Hi Adam,
     
    Everything is being stored fine in the database. After it is pulled into a browser through a DB query it looks fine.
     
    The problem occurs when I pull the text into the editor to edit my text. That is when the odd symbols appear.
  •  01-02-2009, 12:35 PM 47357 in reply to 47355

    Re: Corrupted text when pulling from DB

    1. Do you have problems with this example too?
     
     
    2. Because you pass the string into editor, can you use Response.Write to print the string into the page?

    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

  •  01-02-2009, 12:46 PM 47358 in reply to 47357

    Re: Corrupted text when pulling from DB

    1. When I go back to that page my text is still there and looks fine.
     
    2. The response.write of the data works great...it's only when I pull the text from database into the editor using the follwing line that the text contains symboles...
     
    editor.Text = rsSelectedArticle("article_body")
     
    3. Here is an example of the text stored in the DB..
     
    NEW YEAR’S EVE FAMILY FUN DAY
     
    here's what comes out of the database using response.write
     
    NEW YEAR’S EVE FAMILY FUN DAY
     
    Here's what the text looks like when pulling from the db into your editor
     
    NEW YEAR’S EVE FAMILY FUN DAY
     
  •  01-02-2009, 1:24 PM 47362 in reply to 47358

    Re: Corrupted text when pulling from DB

    1.
     
      <%
               response.write("NEW YEAR’S EVE FAMILY FUN DAY")
               Dim editor
               Set editor = New CuteEditor
               editor.ID = "Editor1"
               'This property provides access to the text within the editable area of the CuteEditor control
               editor.Text = "NEW YEAR’S EVE FAMILY FUN DAY"
               editor.Draw()
       %>
    2.
     
      <%
               SetLocale("en-ca")
               response.write("NEW YEAR’S EVE FAMILY FUN DAY")
               Dim editor
               Set editor = New CuteEditor
               editor.ID = "Editor1"
               'This property provides access to the text within the editable area of the CuteEditor control
               editor.Text = "NEW YEAR’S EVE FAMILY FUN DAY"
               editor.Draw()
       %>
     
    3.
     
      <%
               SetLocale("en-ca")
               dim stringfromDB
               stringfromDB=*************
               response.write("stringfromDB
               Dim editor
               Set editor = New CuteEditor
               editor.ID = "Editor1"
               'This property provides access to the text within the editable area of the CuteEditor control
               editor.Text = stringfromDB
               editor.Draw()
       %>
     
    4.
     
      <%
               response.Codepage = 65001
               response.Charset = "utf-8"
               SetLocale("en-ca")
               dim stringfromDB
               stringfromDB=*************
               response.write("stringfromDB
               Dim editor
               Set editor = New CuteEditor
               editor.ID = "Editor1"
               'This property provides access to the text within the editable area of the CuteEditor control
               editor.Text = stringfromDB
               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

View as RSS news feed in XML