[TYPO3-english] Database sorting danish characters issue

Jigal van Hemert jigal at xs4all.nl
Fri Jan 8 11:57:02 CET 2010


Brian Bendtsen wrote:
> I have discovered a generel problem in the TYPO3 frontend and backend, I 
> believe its related to charset configuration. The problem is with 
> sorting of danish characters, actually it seems to only be a problem 
> with the letter "Å", the last letter in the danish alpabet. 

Sorting (and comparing) is handled in MySQL by setting the collation 
correctly.

> (localconf.php)
> $TYPO3_CONF_VARS['SYS']['UTF8filesystem'] = '1';
> $TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
> $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8'.chr(10).'SET 
> CHARACTER SET utf8';
> 
> (Database table collation)
> utf8_general_ci

This is a very general case insensitive (ci) collation for the utf-8 
character set.

SET CHARACTER SET utf8; sets the client character set and results 
character set to utf8, and the connection character set and connection 
collation to the database character set and collation.

You could use
$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8 COLLATE 
utf_danish_ci';
to use Danish sorting and comparing.
If you add the SET CHARACTER SET utf8 again, the connection collation 
will be set to the database collation (which is utf8_general_ci in your 
case).

For a multi-language site this would not be very useful. TYPO3 would 
need to support collations in queries and DBAL...

Regards, Jigal.


More information about the TYPO3-english mailing list