[Python-Dev] Unicode

M.-A. Lemburg mal@lemburg.com
Tue, 16 May 2000 10:21:46 +0200

"Martin v. Loewis" wrote:
> > comments?  (for obvious reasons, I'm especially interested in comments
> > from people using non-ASCII characters on a daily basis...)
> > nobody?
> Hi Frederik,
> I think the problem you try to see is not real. My guideline for using
> Unicode in Python 1.6 will be that people should be very careful to
> *not* mix byte strings and Unicode strings. If you are processing text
> data, obtained from a narrow-string source, you'll always have to make
> an explicit decision what the encoding is.

Right, that's the way to go :-)
> If you follow this guideline, I think the Unicode type of Python 1.6
> will work just fine.
> If you use Unicode text *a lot*, you may find the need to combine them
> with plain byte text in a more convenient way. This is the time you
> should look at the implicit conversion stuff, and see which of the
> functionality is useful. You then don't need to memorize *all* the
> rules where implicit conversion would work - just the cases you care
> about.

One should better not rely on the implicit conversions. These
are really only there to ease porting applications to Unicode
and perhaps make some existing APIs deal with Unicode without
even knowing about it -- of course this will not always work
and those places will need some extra porting effort to make
them useful w/r to Unicode. open() is one such candidate.

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