Re: UTF-8 Coding of MSSQL 2005 DB
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 26 Mar 2008 16:03:42 +0000 (UTC)
Shawn Beasley (shawn.beasley@xxxxxxxxxx) writes:
Basically, there is no native UTF-8 storage then in MSSQL, am I right?
Right.
I mean, the scripts that we are using in perl are writing to the DB in
UTF8, and the displayed information in the webapp is returning properly,
but when you look at the data in the table, it is displayed
incorrectly. Does that seem right?
The best handling would be to store data in the nvarchar data type as
UCS-2. You would Unicode both in the web application and in the database,
just encoded differently.
I don't know what API you use from Perl, but if you use Win32::SqlServer,
it will handle all necessary conversion from UTF-8 to UCS-2 and back for
you completely seamlessly. I don't know about DBD/DBI, but it may be more
difficult with these, as they are designed to be portable between platforms,
whereas Win32::SqlServer is designer for SQL Server only.
You find Win32::SqlServer on my web site,
http://www.sommarskog.se/mssqlperl/index.html.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- UTF-8 Coding of MSSQL 2005 DB
- From: Shawn Beasley
- Re: UTF-8 Coding of MSSQL 2005 DB
- From: Plamen Ratchev
- Re: UTF-8 Coding of MSSQL 2005 DB
- From: Shawn Beasley
- UTF-8 Coding of MSSQL 2005 DB
- Prev by Date: Re: Getting record position in sql server 2000
- Next by Date: Re: Getting record position in sql server 2000
- Previous by thread: Re: UTF-8 Coding of MSSQL 2005 DB
- Next by thread: help with DDL trigger. Moved from other newsgroup.
- Index(es):
Relevant Pages
|