Re: glade localization woes



On Wed, Jun 16, 2004 at 16:50:17 +0200, A. Pagaltzis wrote:
* Jan Hudec <bulb ucw cz> [2004-06-16 13:36]:
On Wed, Jun 16, 2004 at 13:02:58 +0200, Thierry Vignaud wrote:
last but not least, since Locale::Gettext has no knowledge of
gtk2-perl and cannot and shouldn't know whether gtk+2 is used
or not, there's no reason that this package should enforce
utf8

You are right here. Perl works just right with all string in
locale encoding. Touching Locale::gettext is not a good idea.

May I interrupt? If I understood correctly, Locale::gettext does
not mark the string as UTF-8 for the perl internals, even if you
request UTF-8 encoding from gettext, right?

In that case, that's definitely a bug. I don't think it's a good
idea to have Locale::gettext *force* UTF-8, but when the wrapper
is told to return strings encoded that way, it should certainly
set the corresponding flag on the string so things will Just Work
in Perl.

Yes, I agree with that. Though it would have some tracking to do as to
what domain is used and what charset is selected for that domain. It's,
however, doable and not too hard. The idea is:

- Binding 'textdomain' should set own variable and not call textdomain
- Binding 'gettext' should use that variable and call our version of
  dgettext
- Our version of dgettext should call bind_textdomain_codeset with NULL
  to get the charset. If it is utf-8, or if it is NULL and
  nl_langinfo(CODESET) returned utf-8, mark the string as utf-8.

It can even be done in perl.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature



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