Need debugging knowhow for my creeping Unicodephobia

Robert Kern robert.kern at gmail.com
Thu Feb 11 16:48:12 EST 2010


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




More information about the Python-list mailing list