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

2005-08-09 Thread Steve Kowalik
On Mon, 08 Aug 2005 12:06:48 -0500, Joe Wreschnig uttered > 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

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

2005-08-08 Thread Joe Wreschnig
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 fo

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

2005-08-08 Thread Junichi Uekawa
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 a

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

2005-08-08 Thread Steve Kowalik
On Mon, 08 Aug 2005 10:24:50 +0200, Martin v. Löwis uttered > 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 wi

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

2005-08-08 Thread Martin v. Löwis
Joe Wreschnig wrote: > Which installs ugettext as '_' function into the __builtin__ namespace. > That makes _ return Python 'unicode' objects, which is what programs > should be using internally anyway. > > This is harder if you're trying to localize a module since then you > don't want to screw w

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

2005-08-07 Thread Joe Wreschnig
On Mon, 2005-08-08 at 07:45 +0900, Junichi Uekawa wrote: > Hi, > > While I was hacking at debconf, I noticed that > python's gettext function returns strings encoded in the > original encoding; which will appear as garbage on > the screen. The best way to do gettext in Python is to do: gettex

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

2005-08-07 Thread Junichi Uekawa
Hi, While I was hacking at debconf, I noticed that python's gettext function returns strings encoded in the original encoding; which will appear as garbage on the screen. With python2.4, lgettext is added, which seems to do the right thing and return the string encoded in the current CODESET.