unicode data/UTF-8 characters

  • I updated my question for better understanding: how to search ,update, and delete utf-8 data from sql server 2008 express

    (especially Amharic data)

    i.e I stored unicode data by query "insert into tablenmae (name,id,sex) values(N'ጸጋዬ',N'77አንድ',N'ወንድ')";

    then to search I used the query: "select id from tablenmae where name=N'"+nametextBox.text+"'"; and many other queries but it can search and get the last column only it it means it ignores or not satisfied the where condition

    I used c# 2010 and sql 2008 express

  • I think your problem will be that SQL Server versions 2008, 2005, and 2000 support only UCS-2 16 bit encodings, they don't support UTF-8. The Amharic character set falls in the UCS-2 range, but you need to organise things so that the text box data you are comparing encodes the characters directly as there UCS-2 16 bit code points rather than UTF-8 variable length strings (a mixture of 8, 16, 24, and 32 bits) representing those codepoints. I think that Amharic is placed so that if you use UTF-16 instead of UTF-8 the coding will probably be straightforward UCS-2 (no 4-byte codes used) but I'm not at all certain that it will work like that.

    Last time I did anything like that the conversion (UTF-8 <-> UCS-2) was done automatically somewhere in the guts of either Microsoft's ASP support code or the browser. I don't remember (if anything) what we had to do to make it happen - it's all lost in the mists of time - and anyway I was working with SQL Server 2000 at the time so the conversion probably happens differently with your more modern version of SQL Server and presumably more modern web server.

    Tom

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply