[Zope] Sorting is broken with UTF-8?

Daniel Dekany ddekany at freemail.hu
Thu Apr 14 06:20:54 EDT 2005


I have a Zope 2.7.0(+Plone) instance that uses utf-8 encoding
everywhere. The problem is that alphabetical sorting (like with
DocumentTemplate.sequence.sort(seq, 'locale', ...)) is broken
everywhere: accented letters come after all US-ASCII characters. I have
locale=hu_HU.UTF-8 in zope.conf, still it seems that the collation
algorithm can't handle UTF-8 encoded strings correctly, and since 0x80
is higher than the code of the US-ASCII characters, a character that is
out of the US-ASCII range will be later than the US-ASCII ones. Actually
Python can't sort UTF-8 with strcoll either (at least I couldn't achieve
that), I guess the root of the problem is there.

So, what should I do now? UTF-8 charset doesn't work in reality with
Zope so I should forget it and switch to ISO-8859-x?

-- 
Best regards,
 Daniel Dekany



More information about the Zope mailing list