On 2010-02-11 15:43 PM, mk wrote:
MRAB wrote:

Strictly speaking, only Unicode can be encoded.

How so? Can't bytestrings containing characters of, say, koi8r encoding
be encoded?

I think he means that only unicode objects can be encoded using the .encode() method, as clarified by his next sentence:

What Python 2 is doing here is trying to be helpful: if it's already a
bytestring then decode it first to Unicode and then re-encode it to a
bytestring.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to