[i18n] non-translation but charset related problem + solution
Jan Schneider
jan at horde.org
Tue Feb 18 16:59:32 PST 2003
Zitat von Ivan Noris <noris at bgs.sk>:
> Hello,
> I know this is not the appropriate list, and I'm sorry, but I don't
> have time to subscribe to other lists and maybe you can confirm my
> problem/solution too..
>
> I configured Turba 1.2 RC1 to use shared LDAP directory. The LDAP is
> Sun One Directory Server running on Sol8, using UTF8 encoding. I used
> "'encoding' => 'utf8'" in the sources.php LDAP server definition, but
> the charset was "mangled". The problem seems to be in the PHP function
> utf8_decode, (always?) returning ISO-8859-1 string.
>
> We use Latin2 (iso8859-2) encoding - so the solution was to replace the
> original line in turba/lib/Driver/ldap.php
>
> $result[$field] .= utf8_decode($entry[$field][$j]);
>
> with following one:
>
> $result[$field] .= recode("utf8..latin2", $entry[$field][$j]);
>
> I had to install php4-recode package (on Debian) first.
>
> If anybody had the same problem, maybe this hack could be of any help
> for you. Or, if there's something I really missed, please, let me know.
Your "fix" breaks as soon as someone uses a language that has another
charset than latin2. If you didn't lock the language preference, you should
at least use recode("utf.." . Lang::getCharset, ...
This all been addressed in the code available from CVS (HEAD).
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the i18n
mailing list