Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #653 > unrolled thread

UTF-8 in MSSQL

Started byKeith Sauvant <oecher7.z.ksau@spamgourmet.com>
First post2011-09-08 17:33 +0200
Last post2011-09-08 23:00 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.databases.ms-sqlserver


Contents

  UTF-8 in MSSQL Keith Sauvant <oecher7.z.ksau@spamgourmet.com> - 2011-09-08 17:33 +0200
    Re: UTF-8 in MSSQL Erland Sommarskog <esquel@sommarskog.se> - 2011-09-08 23:00 +0200

#653 — UTF-8 in MSSQL

FromKeith Sauvant <oecher7.z.ksau@spamgourmet.com>
Date2011-09-08 17:33 +0200
SubjectUTF-8 in MSSQL
Message-ID<9cs5hfF6q1U1@mid.dfncis.de>
Hi,

processing unicode data in MSSQL seems to require prefixing of all 
constants in queries by a "N". That is not fun when it comes to unicode 
enabling of big applications...

Is there a way around that?

Thank you in advance
Keith

[toc] | [next] | [standalone]


#654

FromErland Sommarskog <esquel@sommarskog.se>
Date2011-09-08 23:00 +0200
Message-ID<Xns9F5AEA1563397Yazorman@127.0.0.1>
In reply to#653
Keith Sauvant (oecher7.z.ksau@spamgourmet.com) writes:
> processing unicode data in MSSQL seems to require prefixing of all 
> constants in queries by a "N". That is not fun when it comes to unicode 
> enabling of big applications...

In T-SQL all literals are typed, and string literals delimited by ''
are varchar. To get an nvarchar literal, you need N''.

This is not unique to T-SQL; in C++ "" refers to a char[] literal, and to
get a wchar literal you need L"".

As for UTF-8, SQL Server does not support UTF-8 per se; the internal
storage format is UCS-2, and this is also used on the wire. However, a
good client API should hide this fact from you. 


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.ms-sqlserver


csiph-web