[TYPO3-core] RFC #7942: Enable UTF-8 by default

Martin Kutschker masi-no at spam-typo3.org
Wed Nov 10 14:05:06 CET 2010


Am 10.11.2010 13:40, schrieb Michael Stucki:
> Hi Steffen, hello core list :-)
> 
>> Just after some short reading:
>>
>>> $dbConnectionIsUtf8 =
>>> trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'], ' ;') == 'SET
>>> NAMES utf8' ? TRUE : FALSE;
>> ? TRUE : FALSE is not needed, as == returns boolean.
>> I also have "SET CHARACTER SET utf8" from some older advices of "how to
>> do utf-8" in mind (e.g. see [1]). This case would not be covered by this
>> line, however reading the character_set_* variables would lead to the
>> correct decision, wouldn't it?
> 
> This query only changes client + results charset, but it does not change
> the connection charset. However, it's a requirement that all of these
> three (client + connection + results) character sets are UTF-8,
> otherwise you may loose content on your way...

For the connection you could use any other Unicode encoding "ucs2" being the only other that Mysql
supports. In this case Mysql would of course do extra recodings from and to ucs2/utf8 all the time.

And what's more the individual table columns must all be utf8 as well (or ucs2).

Masi


More information about the TYPO3-team-core mailing list