Item8098: [PATCH] UTF-8 Site Charset breaks WikiName normalization for Umlaute

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release:
Applies To: Extension
Component: LdapContrib
Branches:
Reported By: Foswiki:Main.UlrichSpoerlein
Waiting For:
Last Change By: FranzJosefGigler
Hi,

LdapContrib is failing to do the normalization of wiki names and login names for german umlauts, if you happen to run your site on UTF-8. This is very bad, as UTF-8 should be the default anyway IMHO.

Attached is a patch, that will plaster over this by adjusting the s/ö/oe/ substitutions if the charset is UTF-8. A nice side effect of the patch is, that it makes the source code ASCII clean.

There is still an outstanding issue, though. The normalization concatenates the cn attribute as it is coming from LDAP. My name thus should come out as UlrichSpörlein before the patch and UlrichSpoerlein after the patch. The split() however is not taking the Site Locale into consideration, resulting in my wiki name becoming UlrichSpRlein. I tried adding a setlocale(LC_CTYPE, "de_DE.UTF-8") before the split so that the regexp class [:alpha:] includes ö, but nothing changed. I confirmed, that the string in question is UTF-8 encoded (ö is represented as c6b8 or something) and also tried an utf8_upgrade(). This should go into another bug report, however.

-- UlrichSpoerlein - 04 Apr 2009

ItemTemplate edit

Summary [PATCH] UTF-8 Site Charset breaks WikiName normalization for Umlaute
ReportedBy Foswiki:Main.UlrichSpoerlein
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState Closed
WaitingFor
Checkins LdapContrib:5ac3d24b507e
ReleasedIn
I Attachment Action Size Date Who Comment
contrib-ldapcontrib.diffdiff contrib-ldapcontrib.diff manage 2 K 04 Apr 2009 - 07:46 UlrichSpoerlein Makes normalizeWikiName work under UTF-8 charsets
Topic revision: r4 - 28 Apr 2009, FranzJosefGigler
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy