Re: utf-8 to ucs-2

From: Michael \(michka\) Kaplan (
Date: Wed Jun 19 2002 - 02:39:57 EDT

On the whole, it is really a *bad* idea to store UTF-8 data in an MSSQLS
nvarchar column. The only thing I would really suggest is that you get the
data out via whatever means you used to get it in, then make some quick
MultiByteToWideChar calls to convert the data.

SQL Server itself does not provide tools here -- this is the disadvantage of
lying to a database engine (you can't expect much help from it later!).


Michael Kaplan
Trigeminal Software, Inc. --

----- Original Message -----
From: "Paul Hastings" <>
To: <>
Sent: Tuesday, June 18, 2002 10:55 PM
Subject: utf-8 to ucs-2

> since there were so many translation questions this week i
> guess one more won't hurt. i have a bunch of text data,
> utf-8 encoded, stored in sql server nvarchar columns.
> data was inserted using coldfusion 5 which really didn't
> support unicode (hence the utf-8 encoding). i now need
> to xfer this data to a cfmx (coldfusion 6) system that
> wants ucs-2 encoding (cf is now java based & uses
> merant jdbc drivers).
> i've been playing around with java string class getBytes
> method but i can't seem to get it to understand that the
> input really is utf-8 (yes, i'm a java novice).
> would anyone point me towards some info/resources
> that might help? any advice/suggestions also welcome.
> thanks.
> ----------------------------------------------------
> Paul Hastings
> Director Environmental Information Center
> Thailand Environment Institute
> Member Team Macromedia (Allaire)
> ---------------------------

This archive was generated by hypermail 2.1.2 : Wed Jun 19 2002 - 01:01:24 EDT