Re: UTF-8 encoding in AJAX web application.




"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.206a3c6dc027898998d9d0@xxxxxxxxxxxxxxxxxxxxxxx
Allan Ebdrup <ebdrup@xxxxxxxxxxxxxxx> wrote:
I tried with a "ntext" and that works for saving UTF-8 chars as far as
I've
tested. But I should really convert from UTF-8 to UCS-2 before saving
right?
and back when loading.

No - the driver will do that for you.

Is this done by detecting the UFT8 preamble? And the the driver converts to
UCS-2? And if so how come the result is still in UTF-8 when I retrieve the
data again?
Or is there no conversion?
Why is it important that MSSQL only supports UCS-2 unicode if everything
works fine with UTF-8?
I can see that everything works fine when storing a UTF-8 string in an ntext
column, and when I query the data in queryanalyzer the string is displayed
correctly in the result set, how can this be if MSSQL only supports UCS-2
encoding?
How is the string stored? in UTF-8 or UCS-2?

Sorry for all the questions, I'm just tryng to understand what's going on.

Kind Regards,
Allan Ebdrup


.



Relevant Pages

  • 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: UTF-8 encoding in AJAX web application.
    ... you can do is set the collation. ... 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 ...
    (microsoft.public.dotnet.languages.csharp)
  • 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)
  • 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: MySQL -> MSSQL
    ... Da Du eine PHP Applikation hast, kannst Du die erforderliche Konvertierung von UTF-8 auf UCS-2 leider vergessen. ... Du kannst die UTF-8 Daten also nur in einem normalen Textfeld ablegen, das funktioniert auch, der SQL Server kann allerdings die Unicode Daten nicht korrekt interpretieren. ... Es werden bei varchar bzw. char maximal 255 Zeichen unterstützt. ...
    (de.comp.datenbanken.misc)