[unicode] SQL Server and UTF-8 (fwd)

From: Roozbeh Pournader (roozbeh@sharif.edu)
Date: Sun Mar 25 2001 - 15:29:40 EST


This is what I received from a colleague. Anyone who can help?

--roozbeh

---------- Forwarded message ----------
Date: Sun, 25 Mar 2001 23:07:19 +0430 (IRDT)
From: M. Mahjurian <reza@sharif.edu>
To: Roozbeh Pournader <roozbeh@sharif.edu>
Subject: SQL Server and UTF-8

I'm running SQL Server 2000 and I want to access the database from a web
application. I use PHP as my scripting language. It can't handle data in
UTF-16 format, because in PHP strings are stored in null terminated
format. So I need to provide the data in UTF-8 format to my script.
How can I accomplish this?
Is it possible to define some Stored Procedures in my database to convert
from UTF-16 to UTF-8 when running my SELECT statements?
for example something like this:
SELECT to_utf_8(field1), to_utf_8(field2) FROM mytable;

I know if I use binary data types I can store UTF-8 in the database but
since it makes the data unreadable to other applications, I want to store
it in UTF-16 format in the database.



This archive was generated by hypermail 2.1.2 : Fri Jul 06 2001 - 00:17:15 EDT