[TYPO3-core] RFC: Bug #5088: cache is not saved properly because of charset conflict in the database

Michael Stucki michael at typo3.org
Mon Apr 2 17:14:43 CEST 2007


Hi Martin,

> Dmitry Dulepov schrieb:
>> Michael Stucki wrote:
>>> PS: Can you explain me why $TYPO3_CONF_VARS[SYS][setDBinit] = "SET
>>> NAMES utf8;" changes the connection charset to UTF8 (that's expected)
>>> but adding "CHARACTER SET utf8" behind makes it remain as Latin1?
>> 
>> Probably a bug... If I remember correctly, SET NAMES is equal to several
>> "SET character_set_xxx=" directives.
> 
> SET NAMES x is the same as these three statements:
> 
> SET character_set_client = x;
> SET character_set_results = x;
> SET character_set_connection = x;
> 
> "CHARACTER SET utf8" means nothing at all and is no valid command.

This was a typo of course. I was using "SET ..." as it is also described
here: http://wiki.typo3.org/index.php/UTF-8_support

I do not understand why this causes the connection to be reset to the
server default, but I assume it could be one more problem adding trouble
here...

I made a test for this on my console. MySQL is still using Latin1 by
default, so UTF8 must be set for every connection:

mstucki at debian:~$ echo "SET NAMES utf8; SHOW VARIABLES;" | mysql typo3_test | grep -i character_set_
character_set_client        utf8
character_set_connection    utf8
character_set_database      latin1
character_set_filesystem    binary
character_set_results       utf8
character_set_server        latin1
character_set_system        utf8

mstucki at debian:~$ echo "SET NAMES utf8; SET CHARACTER SET utf8; SHOW VARIABLES;" | mysql typo3_test | grep -i character_set_
character_set_client        utf8
character_set_connection    latin1 <== watch this!
character_set_database      latin1
character_set_filesystem    binary
character_set_results       utf8
character_set_server        latin1
character_set_system        utf8

Weird, isn't it? Anyway, this is probably too deep in detail, so if you
don't have the solution for this at hand, I suggest to stop this discussion
and I will post it again in typo3.dev...

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list