Results 1 to 2 of 2
  1. #1
    sagarsway is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default Problem while inserting UTF-8 characters in MS-SQL Server 2000 Database

    Hi All ,

    I have to insert an UTF-8 encoded string in database in MS SqlServer 2000

    My application need to process spanish chracters, I get this in an XML string from the Flash Application,

    e.g
    if I have input string like "ю"
    after UTF-8 encoding that gets converted into "€Á‚…‰‹œÝ›‘ŽŸåã”"

    this string I need to insert in the databse in MS-SQLServer 2000
    but after insertion this encoded string converts into "?????????????????????œ?ž ??????"

    So when later I try to retrieve the string and decode it I get incorrect output.

    please help me in finding solution.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    There are many 8-bit character sets in use. Your Flash application is passing you data in a specific set. Apparently, it is not UTF-8. It *might* be ISO 8859-1.

    Java uses Unicode, which is a 16 bit character set. UTF-8 is essentially the first 256 Unicode characters.

    1. Find out what character set (encoding) the Flash application is using. Until you know this for certain, you will have data corruption.

    2. Determine if UTF-8 supports all the characters you are receiving. If not, you will have to modify the database or live with some data loss. SQL Server 2000 supports Unicode.

    3. Use the proper Charset class to decode your input to a String, which will be in Unicode.

    4. Normally, JDBC drives handle character set conversions. I suspect you are losing data when you first bring it into your Java program and convert it to a String.

Similar Threads

  1. JSP Connecting to MS SQL SERVER 2000 using JDBC
    By hisouka in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 09-02-2008, 10:23 AM
  2. Inserting data to database from the form
    By Ms.Ranjan in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-17-2008, 02:06 AM
  3. Replies: 0
    Last Post: 02-07-2008, 09:57 AM
  4. Inserting file in to database
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-07-2008, 09:39 AM
  5. Help, conect a JSP, SQL SERVER 2000
    By Marcus in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-06-2007, 04:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •