[dev] Problem sorting out a problem with charset conversion

Etienne Goyer etienne.goyer at linuxquebec.com
Tue Nov 11 11:47:15 PST 2003


Hi,

I have a hook, _prefs_hook_fullname, that grab the full name (cn) of a
user from LDAP and set the corresping fullname pref accordingly.  It
work correctly, but I have problem when the full name contain 8 bit
characters (accent such as é, è, à, etc).  My pref backend driver is 
mysql.  

When the Horde portal page appear, the uppermost frame display :

"Welcome, Test accent -?- -?- -?-"

The page encoding is set to UTF-8.  When I change the encoding in my
browser to ISO-8859-1, the frame become :

"Welcome, Test accent 2 -é- -è- -à-"

Which is what it should be.

IT is my understanding that LDAP return string in UTF-8.  my
_prefs_hook_fullname does not do any character encoding conversion, it
just return the cn as provided by LDAP.  So, somewhere between LDAP ->
MySQL prefs table -> output, this pref is converted from UTF-8 to
ISO-8859-1 but is not converted back before being displayed.  Could
this be correct ?  How should I correct, or work-around, that ?

Thanks for your insight, I have been banging my head at this one for a
few hours and getting hopeless ... :(

-- 
Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com


More information about the dev mailing list