[Solar-talk] UTF-8

Paul M Jones pmjones at solarphp.com
Tue Jul 25 14:23:56 PDT 2006


On Jul 20, 2006, at 3:57 PM, Rodrigo Moraes wrote:

> MS-SQL: it also seems that the charset can't be set at runtime. So
> it's up to the user adhere to the same charset set in the database
> initialization. Well, this is a guess.

This doesn't look good:

http://support.microsoft.com/kb/q232580/

> Some applications (especially those that are Web based) must deal  
> with Unicode data that is encoded with the UTF-8 encoding method.  
> SQL Server 7.0 and SQL Server 2000 use a different Unicode encoding  
> (UCS-2) and do not recognize UTF-8 as valid character data. This  
> article discusses some options for dealing with this situation.

...

> Storing UTF-8 data on SQL Server means that you can not use SQL  
> Server to sort or find ranges of these values as if the data were  
> valid character data. The types of operations on columns containing  
> UTF-8 data that would not return expected results include "ORDER  
> BY", greater-than ">" and less-than "<" comparisons, and the built- 
> in SQL Server string manipulation functions such as SUBSTRING().
>
> However, equality comparisons, will work as long as the strings  
> being compared are equivalent at a byte level. Note that if you  
> store UTF-8 data in SQL Server you should not use character columns  
> (CHAR/NCHAR/VARCHAR and so forth). UTF-8 is not valid character  
> data to SQL Server

I do not like the sound of that.



--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.   <http://solarphp.com>

Savant: The simple, elegant, and powerful solution for
templates in PHP.   <http://phpsavant.com>




More information about the solar-talk mailing list