A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/006607.html below:

[Python-Dev] decoding errors when comparing strings

[Python-Dev] decoding errors when comparing strings [Python-Dev] decoding errors when comparing stringsFredrik Lundh Fredrik Lundh" <effbot@telia.com
Sat, 15 Jul 2000 16:09:25 +0200
with the locale aware encoding mechanisms switched off
(sys.getdefaultencoding() =3D=3D "ascii"), I stumbled upon some
interesting behaviour:

first something that makes sense:

    >>> u"abc" =3D=3D "abc"
    1

    >>> u"=E5=E4=F6" =3D=3D "abc"
    0

but how about this one:

    >>> u"abc" =3D=3D "=E5=E4=F6"
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    UnicodeError: ASCII decoding error: ordinal not in range(128)

or this one:

    >>> u"=E5=E4=F6" =3D=3D "=E5=E4=F6"
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    UnicodeError: ASCII decoding error: ordinal not in range(128)

ignoring implementation details for a moment, is this really the
best we can do?

</F>




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4