Re: UTF-8 encoding in AJAX web application.



"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:mmHNj7paHHA.4088@xxxxxxxxxxxxxxxxxxxxxxxxx
In addition, for SQL Server (7.0 or 2000) unicode datatype, it is stored
in
UCS-2 charset (no matter the data is originally encoded in UTF-8, UTF-16
or....). Here is a good MSDN reference introducing the international
features in SQL Server 2000

http://msdn2.microsoft.com/en-us/library/aa902644(SQL.80).aspx

The only problem with saving the text as binary data (image) is that I can't
search the text.
The data was originally saved in a "text" column, there is no "ntext" all
you can do is set the collation.
I tried to set the collation to UCS-2 but couldn't find it in the list of
possible collations, what collation should I use to be able to use UCS-2?

I was thinking I could convert my UTF-8 encoded string to UCS-2 and save it
in the database.
Then I could convert from UCS-2 to UTF-8 when fetching the string from the
database.
How do I convert a string from UTF-8 to UCS-2 and back?

Kind Regards,
Allan Ebdrup


.



Relevant Pages

  • Re: UTF-8 encoding in AJAX web application.
    ... And if so how come the result is still in UTF-8 when I retrieve the ... actually UTF-16, which is very similar to UCS-2, but you can ... a string is "UTF-8 encoded". ... When you fetch it from the database, the driver ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: UTF-8 encoding in AJAX web application.
    ... But I should really convert from UTF-8 to UCS-2 before saving ... No - the driver will do that for you. ... And if so how come the result is still in UTF-8 when I retrieve the ... I can see that everything works fine when storing a UTF-8 string in an ntext ...
    (microsoft.public.dotnet.languages.csharp)
  • Converting to UCS-2 or UTF-16 for use by a C extension
    ... to convert a Ruby input string into UCS-2 or possibly UTF-16 encoding. ... encoded internally as UTF-8... ...
    (comp.lang.ruby)
  • Re: Binary-safe?
    ... but I'm still a bit lost how one is binary-safe and the other ... | parameter was an empty string. ... etc. that's the literal string contents for 'a' in ucs-2. ... C and PHP both view strings as arrays ...
    (alt.php)
  • Re: Chinese character display problem
    ... SQL nvarchar can indeed store unicode data. ... However the encoding used is UCS-2, like Windows NT/2K - two bytes per char. ... This instructs IIS to convert strings from UCS-2 to UTF-8. ...
    (microsoft.public.sqlserver.programming)