[Python-Dev] Re: gettext in the standard library

Martin von Loewis loewis@informatik.hu-berlin.de
Sun, 20 Aug 2000 12:51:16 +0200 (MET DST)


> Hmm, if your catalogs are encoded in UTF-8 and use non-ASCII
> chars then the traditional API would have to raise encoding
> errors

I don't know what you mean by "traditional" here. The gettext.gettext
implementation in Barry's patch will return the UTF-8 encoded byte
string, instead of raising encoding errors - no code conversion takes
place.

> Perhaps the return value type of .gettext() should be given on
> the .install() call: e.g. encoding='utf-8' would have .gettext()
> return a string using UTF-8 while encoding='unicode' would have
> it return Unicode objects.

No. You should have the option of either receiving byte strings, or
Unicode strings. If you want byte strings, you should get the ones
appearing in the catalog.

Regards,
Martin