Python 1.6a2 Unicode bug (was Re: comparing strings and ints)

fredrik at pythonware.com fredrik at pythonware.com
Wed Apr 26 05:11:57 EDT 2000


Fredrik Lundh wrote:
> Aahz Maruch <aahz at netcom.com> wrote:
> > >Python 1.6a2 (#0, Apr  5 2000, 23:56:55)
> > >Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> > >>>> u"abc" < "åäö"
> > >Traceback (most recent call last):
> > >  File "<stdin>", line 1, in ?
> > >ValueError: UTF-8 decoding error: unexpected code byte
> >
> > That looks like a bug to me.
>
> as far as I can tell, it's supposed to be a feature.
>
> if you mix 8-bit strings with unicode strings, python 1.6a2
> attempts to interpret the 8-bit string as an utf-8 encoded
> unicode string.
>
> but yes, I also think it's a bug.  but this far, my attempts
> to get someone else to fix it has failed.  might have to do
> it myself... ;-)

postscript: the powers-that-be has decided that this is not
a bug.  if you thought that strings were just sequences of
characters, just as in Perl and Tcl, you're in for one big
surprise in Python 1.6...

</F>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list