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

Re: python's gettext.gettext broken, use gettext.lgettext


> > It is also useless for the issues at hand: since linda and
> > apt-listchanges apparently use local strings, giving them Unicode
> > strings would break them. So Junichi's change looks right to me.
> > 
> Standing up for Linda, I am more than willing to fix her usage of
> gettext, and I am currently investigating using Joe's suggestion, to
> see what that gives me. 
> Anyway, in Python, unicode string objects behave the same as normal
> string objects, so to my mind, the breakage should be minimal.

What's broken about linda currently, and what following Joe's 
suggestion will still break linda is that linda doesn't 
follow the current CODESET.

You'd expect iso-8859-1 output on stdout when the locale says so, and 
utf-8 output on stdout when the locale says so.

'ugettext' is a python's invention of gettext which only 
returns UTF-8; which you will have to call like:

print _("some string").encode(locale.nl_langinfo(CODESET))

as opposed to 

print _("some string")
(if _ is bound to lgettext).

Junichi Uekawa, Debian Developer   http://www.netfort.gr.jp/~dancer/
183A 70FC 4732 1B87 57A5  CE82 D837 7D4E E81E 55C1 

Reply to: