[Python-Dev] Re: [I18n-sig] Changes to gettext.py for Python 2.3

Martin v. L÷wis martin@v.loewis.de
16 Apr 2003 21:20:34 +0200

Barry Warsaw <barry@python.org> writes:

> Right, but see above.  E.g. if your string literals are all Spanish and
> you want a Turkish translation, then utf-8 is the only common encoding
> you could possibly use in a .po file, right?

That's why your string literals should never be all Spanish. If you
have Spanish string literals and use escape codes in the msgid,
reading the Spanish msgid becomes difficult, anyway.

> > 3. By converting the msgids, they are also changing them. That means
> >    the msgids are not really suitable as keys anymore.
> Is this still a problem for when charset=utf-8?

If the msgids are UTF-8, with non-ASCII characters C-escaped,
translators will *still* put non-UTF-8 encodings into the catalogs.
This will then be a problem: The catalog encoding won't be UTF-8,
and you can't process the msgids.