Gtk2, Locale::TextDomain and utf-8 locales




Hiho,

is everyone using the Gtk2 and Locale::TextDomain modules successfully 
with utf-8 locales?

Here a short description of my problems and some diagnostics:

- I use Locale::TextDomain with 7bit message id's and utf8
  message catalogs

- everything works fine if I set an iso-latin-1 locale
  (LC_ALL=de_DE.iso-8859-1)
  => Locale::TextDomain returns binary resp. iso-latin-1
     encoded strings not having the utf-8 flag set
  => Gtk2 binding converts them to utf-8, since gtk2 always
     expects utf-8 encoded data
  => everything displays correctly

- but if I set an utf-8 locale (LC_ALL=de_DE.utf-8) I get
  corrupted output resp. a "latin-1" output of the utf-8
  encoded bytes:
  => Locale::TextDomain returns utf-8 encoded strings BUT
     still doesn't set the utf-8 flag
  => Gtk2 binding still converts data to utf-8, because
     the variables claim to carry non-utf-8 data
  => we see the typical "twice encoded" utf-8 stuff

Some time ago and in another (non Gtk2) context I had a long discussion
with Guido Flohr, the author of Locale::TextDomain, about the utf-8 flag
and that Locale::TextDomain doesn't set it, even if it returns utf-8 
encoded data. He simply don't like the Perl >= 5.8 way of utf-8 handling
and think it's better to ignore the utf-8 flag completely, which may 
work if all affected modules handle this the same ignorant way. But 
since Gtk2 does it right (in may opinion) we (at least I ;) have a 
conflict here.

The only workaround I can imagine is to wrap Locale::TextDomain's 
exported functions and set the utf-8 flag on all return values if an 
utf-8 locale is in effect.

Anybody with a better idea?

Regards,

Joern

-- 
$a=$a[8][67][9][0][42][214][82][78][0][50][69][68][69][82][0][73][78][0]
[65][0][20][16][0][68][73][77][69][78][83][73][79][78][65][76][0][65][82
][82][65][89]=sub{sub _($){print$_[ z]}($z,$i)= _;(++$i)while!$z->[$i];$
s+=$i;_ chr($i+32);$s!=2292&&&$a($z->[$i],$c>>$e)};&$a(\ a,$d<<$f);_"\n"

Attachment: pgpQ9EPSEBfPM.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]