compile(unicode) & source encoding

Denis S. Otkidach ods at strana.ru
Fri Nov 28 13:24:30 EST 2003


On Fri, 28 Nov 2003, Just wrote:

J> > 2. Why there is now option to define encoding of source
J> passed to
J> > compile function?  Yes, I can define encoding by prefixing
J> my
J> > code with '# -*- coding: %s -*-\n' % encoding, but it's not
J> > handy.
J>
J> You can just pass a unicode string (in 2.3 at least), so you
J> can do the
J> decoding yourself.

There is a big difference bitween oridinal (one byte per
character) encoding and utf-8, so this breaks code dealing with
8-bit strings.

-- 
Denis S. Otkidach
http://www.python.ru/      [ru]






More information about the Python-list mailing list