Re: UTF-8 Coding of MSSQL 2005 DB



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
.



Relevant Pages

  • Re: Newbie - why are column properties greyed out?
    ... To change a column use ALTER TABLE ALTER COLUMN for the changes where it ... opens the Table Designer. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: UTF-8 Coding of MSSQL 2005 DB
    ... Description of storing UTF-8 data in SQL Server ... International Features in Microsoft SQL Server 2005 ... 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. ...
    (comp.databases.ms-sqlserver)
  • Re: Warning! Serious design flaw dataset / table adapter designer
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... dataset designer creating both data tables and related table adapters. ... The dataset is a disconnected container for holding a subset of the data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problem using Access or Query Designer to run queries in SQL Serve
    ... >or Query Designer within Enterprise Manager, it works and I get data back. ... >ODBC Call Failed [ODBC SQL Server Driver] Timeout Expirederror in Access ... >[ODBC SQL Server Driver] Timeout Expired ...
    (microsoft.public.sqlserver.odbc)
  • Re: Enterprise Mgr - alter table fails
    ... MicrosoftODBC SQL Server DriverSQL ServerCould not create constraint. ... Here is a list of know defenciencies with the Table Designer: ... The transaction scope is wacko. ... In the generated script, ...
    (microsoft.public.sqlserver.tools)