[Python-Dev] Re: [I18n-sig] Changes to gettext.py for Python 2.3
Martin v. L÷wis
23 Apr 2003 00:15:08 +0200
Barry Warsaw <firstname.lastname@example.org> writes:
> So I propose to remove the coerce flag, but still Unicode-ify both
> msgids and msgstrs. Then .ugettext() will just return the Unicode
> msgstr in the catalog, while .gettext() will encode it to an 8-bit
> string based on the charset. Personally, I think most i18n Python apps
> are going to want to use .ugettext() anyway, so for the average program
> this will just work as expected.
> I have the tests passing for this change. Any objections?
For safety, I'd recommend that you use byte string msgids if
conversion to Unicode fails. Otherwise, I'm fine with automatically
coercing everything to Unicode.
I do know about catalogs that use Latin-1 in msgids (to represent
accented characters in the names of authors). That should not cause