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/2001-May/014661.html below:

[Python-Dev] "data".decode(encoding) ?!

[Python-Dev] "data".decode(encoding) ?! [Python-Dev] "data".decode(encoding) ?!Michael Hudson mwh@python.net
09 May 2001 21:13:46 +0100
"M.-A. Lemburg" <mal@lemburg.com> writes:

> I've attached the patch. Due to a small reorganisation the patch is
> a little longer -- symmetry has its price at C level too ;-)

I may be being dense, but can you explain what's going on here:

->> u'\u00e3'.encode('latin-1')
'\xe3'
->> u'\u00e3'.encode("latin-1").decode("latin-1")
Traceback (most recent call last):
  File "<input>", line 1, in ?
UnicodeError: ASCII encoding error: ordinal not in range(128)

Can you come up with some other example I can use it tomorrow's
python-dev summary?

Cheers,
M.

-- 
  Remember - if all you have is an axe, every problem looks 
  like hours of fun.                                        -- Frossie
               -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html




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