[TYPO3-dev] Index of table sys_refindex

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon Nov 6 10:39:05 CET 2006


Dmitry Dulepov schrieb:
>>  Wouldn't it be at least necessary to set
>> ----
>> mysql_query('SET NAMES utf8',$this->link); mysql_query('SET CHARACTER 
>> SET utf8',$this->link);
>> ----
>>  in t3lib_db to make this work?
> 
> Depends on my.cnf settings.

Yes, but you can change it via SET commands.

>>  I know that we don't store UTF-8 data in latin1, but we simply don't
>>  tell MySQL that it's UTF-8 (IMHO).
> 
> 
> It is not necessary if server is setup for utf-8 charset. If database is 
> utf-8 and tables are utf-8 and connection is utf-8, server will expect 
> utf-8 data. It is all controlled by settings in my.cnf. If they are not 
> set to utf-8, it can be changed by those "SET" things.

Use this command to show current settings:

SHOW VARIABLES LIKE 'character_set%';

Note that there are 5 (!) possible charsets:

Client (what the client uses, eg for mysql_real_escape)
Connection (what the client sends)
Server (what the server uses)
Results (what the server sends back)
Db (the actual storage format)

SET CHARACTER SET affects the serber setting.
SET NAMES affects client, connection and results.

See http://dev.mysql.com/doc/refman/4.1/en/charset-connection.html

To get the server version (to avoid any compatibility problems) use
mysql_get_server_info()

Masi




More information about the TYPO3-dev mailing list