[I18n-sig] Re: gettext in the standard library

M.-A. Lemburg mal@lemburg.com
Mon, 04 Sep 2000 23:56:50 +0200

François Pinard wrote:
> [M.-A. Lemburg]
> > Once the "declare" statement is in place you should also be able to write:
> > declare encoding = "utf-8"
> > ... u"utf-8 encoded string" ...
> > in Python source code.
> I'm not aware of that "declare" statement (or declaration?), but it sounds
> like addressing a need.  But if it exists as stated above, I predict for
> myself that I'll often forget the `u' prefix. :-).
> Is that what you meant when saying that the programmer will have to be
> aware all the time if using Unicode strings?  It looks like it.
> The POT extractors will have to be modified to know such conventions.

The "declare" statement will be a PEP for 2.1. Until then you'll
have to stick to the _ function trick I posted to Martin.

Note that you will still have to use the "u" string modifier
to have the compiler trigger the conversion. There will probably
also be a similar recoder for 8-bit string literals, but this
will only work provided that the default encoding is set to
something a little more capable than ASCII, e.g. utf-8 or

Marc-Andre Lemburg
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/