views:

833

answers:

2

I'm trying to setup a sqlserver 2005 that will be accessed using C++ and ODBC (the data read will be sent in XML files). So, I want to read data from the database (preferably utf-8), compose a XML file and send it.

I have been browsing around and i haven't found a way to setup the database and the tables for using utf-8 (as in MySQL). I have read that internally sqlserver uses UCS-2

Is it possible to setup a sqlserver 2005 database (or a table or a field) for using utf-8?

if not, which is the recommended way to do that?

Thank you in advance

+1  A: 

Hopefully the following article from MSDN - Description of Storing UTF-8 data in SQL Server will help. I had a similar problem in 2000, but I see from the article that they have updated it to apply to SQL 2005.

Miles D
+1  A: 

You can ask for unicode data (UTF16 or UCS2) and convert it to UTF-8 where you need it.

UTF-8 is full unicode format, and conversion is fast and easy.

dmajkic