Friday, February 25, 2005

MySQL, ODBC, and TIS-620

MySQL Reference Manual :: 5.8.7 Problems With Character Sets: "Hi guys!
Here You are OVERALL solution for 4.1 that makes Your php (for example) code 'crosshosted' i.e. it will not depend on MySQL server charset options (it's very useful when host admin is not available :) ) :

After connecting (@mysql_connect) and selecting (@mysql_select_db) a database You should make the following:
$set = @mysql_query ('SET NAMES CP1251');
$set = @mysql_query ('SET COLLATION_CONNECTION=CP1251_GENERAL_CI');

may be just first SET is enough even.

Remove ANY stuff concerning charsets from my.ini (my.cnf) just forget it and set connection properties as above. Some stupid strings from errors.log will gone as bonus :)"

For Thai charset, see below.

set names tis620
set collation_connection=tis620_thai_ci

It works very well with ODBC 3.51 on VS.NET 2003.

No comments: