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

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

On Mon, 2005-08-08 at 21:34 +0900, Junichi Uekawa wrote:
> Hi,
> > > 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:

No, it doesn't return UTF-8, it returns unicode objects. They're
automatically recoded when you try to print them (based on the same
function lgettext uses, locale.getpreferredencoding()). As Steve said,
unicode objects are basically like str objects, so code changes should
be minimal. I'll take a look at Linda/Lintian soon to see what needs to
be done, but I suspect it'll be trivial.
Joe Wreschnig <piman@debian.org>

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: