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 - need help: Storing foreign char to SQL DB.

ASP - need help: Storing foreign char to SQL DB.

Scheduled Pinned Locked Moved Web Development
databasehelptutorial
4 Posts 3 Posters 0 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
    ckatili
    wrote on last edited by
    #1

    Hi, I have a problem on storing foreign char to SQL DB. If user inputs a foreign char from asp page, for example, "ROSÉ", it will be stored in the DB as "ROSé". I need to be able to store as it is in the DB, "ROSÉ". BTW, it is displayed properly in the Web GUI. Thanks for any help that you can provide, Charles "Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell

    S H C 3 Replies Last reply
    0
    • C ckatili

      Hi, I have a problem on storing foreign char to SQL DB. If user inputs a foreign char from asp page, for example, "ROSÉ", it will be stored in the DB as "ROSé". I need to be able to store as it is in the DB, "ROSÉ". BTW, it is displayed properly in the Web GUI. Thanks for any help that you can provide, Charles "Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell

      S Offline
      S Offline
      Steve McLenithan
      wrote on last edited by
      #2

      You are having a problem with character encoding. The easiest way to fix this problem is to simply replace the É with É the html encoded equivalent before inserting into the database. For a complete list of such encodings visit this page: http://www.bbsinc.com/iso8859.html[^]

      Steve McLenithan
      Is Bert Evil? | Homer: "Hello, operator, gimme the number for 911!"

      1 Reply Last reply
      0
      • C ckatili

        Hi, I have a problem on storing foreign char to SQL DB. If user inputs a foreign char from asp page, for example, "ROSÉ", it will be stored in the DB as "ROSé". I need to be able to store as it is in the DB, "ROSÉ". BTW, it is displayed properly in the Web GUI. Thanks for any help that you can provide, Charles "Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        The Server object should provide you with some methods to encode and decode characters. Also, make sure the database uses MBCS or Unicode for strings. In SQL Server, this is nvarchar or nchar (which pads extra space with spaces).

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        1 Reply Last reply
        0
        • C ckatili

          Hi, I have a problem on storing foreign char to SQL DB. If user inputs a foreign char from asp page, for example, "ROSÉ", it will be stored in the DB as "ROSé". I need to be able to store as it is in the DB, "ROSÉ". BTW, it is displayed properly in the Web GUI. Thanks for any help that you can provide, Charles "Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell

          C Offline
          C Offline
          ckatili
          wrote on last edited by
          #4

          Thanks Steve and Heath for your reply. I found the solution, although it was not obvious at first. It turns out that web application uses UTF-8 encoding, and SQL uses UCS-2. This different encoding standard caused the wrong data conversion. The following article explains the issue: http://support.microsoft.com/default.aspx?scid=kb;EN-US;232580 I hope this helps other people who has similar issue. Charles "Computers are like Old Testament gods; lots of rules and no mercy." -JosephCampbell

          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