Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Store Rich Text in DATA Base

Store Rich Text in DATA Base

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestion
4 Posts 3 Posters 55 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CARBER
    wrote on last edited by
    #1

    Hello, i use ajax, HtmlEditorExtender to let users writing their own description i store in database, and in my database i can see properly data store in table like this :

    '๐Ÿ”ธ๐Ÿ–ค DANCE SQUARE ๐Ÿ–ค๐Ÿ”ธ\n๐Ÿ“ LA TRILOGIE :\n3 dates ร  ne surtout pas manquer\n.\n๐ŸŸงโ—พ๏ธ 29 Octobre - LA'

    but when i read data by sql, in string variable, i lose all the specials characters like hearts in my example, all specials characters are replace by ? what should i do to keep specials characters ? (correctly store in database.) i read like this :

    if (!res.IsDBNull(i))
    ss {
    return res.GetString(i);
    }
    else
    {
    return string.Empty;
    }

    R S 2 Replies Last reply
    0
    • C CARBER

      Hello, i use ajax, HtmlEditorExtender to let users writing their own description i store in database, and in my database i can see properly data store in table like this :

      '๐Ÿ”ธ๐Ÿ–ค DANCE SQUARE ๐Ÿ–ค๐Ÿ”ธ\n๐Ÿ“ LA TRILOGIE :\n3 dates ร  ne surtout pas manquer\n.\n๐ŸŸงโ—พ๏ธ 29 Octobre - LA'

      but when i read data by sql, in string variable, i lose all the specials characters like hearts in my example, all specials characters are replace by ? what should i do to keep specials characters ? (correctly store in database.) i read like this :

      if (!res.IsDBNull(i))
      ss {
      return res.GetString(i);
      }
      else
      {
      return string.Empty;
      }

      R Offline
      R Offline
      RedDk
      wrote on last edited by
      #2

      Even money's on this (NOUS VOYON (sp?)): CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; A blind man could probably use GOOGLE to find this but ... I haven't got a blind man's machine so this is a conjecture on my part. (Un aveugle pourrait probablement utiliser GOOGLE pour trouver cela mais ... je n'ai pas de machine pour aveugle, donc c'est une conjecture de ma part.)

      C 1 Reply Last reply
      0
      • R RedDk

        Even money's on this (NOUS VOYON (sp?)): CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; A blind man could probably use GOOGLE to find this but ... I haven't got a blind man's machine so this is a conjecture on my part. (Un aveugle pourrait probablement utiliser GOOGLE pour trouver cela mais ... je n'ai pas de machine pour aveugle, donc c'est une conjecture de ma part.)

        C Offline
        C Offline
        CARBER
        wrote on last edited by
        #3

        Yes, but an intelligent man could understand that I have already found and applied this, but it is not enough

        1 Reply Last reply
        0
        • C CARBER

          Hello, i use ajax, HtmlEditorExtender to let users writing their own description i store in database, and in my database i can see properly data store in table like this :

          '๐Ÿ”ธ๐Ÿ–ค DANCE SQUARE ๐Ÿ–ค๐Ÿ”ธ\n๐Ÿ“ LA TRILOGIE :\n3 dates ร  ne surtout pas manquer\n.\n๐ŸŸงโ—พ๏ธ 29 Octobre - LA'

          but when i read data by sql, in string variable, i lose all the specials characters like hearts in my example, all specials characters are replace by ? what should i do to keep specials characters ? (correctly store in database.) i read like this :

          if (!res.IsDBNull(i))
          ss {
          return res.GetString(i);
          }
          else
          {
          return string.Empty;
          }

          S Offline
          S Offline
          Sam Hobbs
          wrote on last edited by
          #4

          Probably your data is Unicode or UTF-8. I am not an expert on such things but you should ensure the data is being processed approriately. One possibility is the font being used. The data might be just fine but if you are not using a font that supports Unicode or UTF-8 (whatever is relevant) then you won't see it correctly. However the "\n" implies it is something else. That character is the carriage return, such as the Enter key in the keyboard. Note that Rich Text is not the same as HTML. The formats are very different.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups