[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Need debugging knowhow for my creeping Unicodephobia

Robert Kern

2/11/2010 9:48:00 PM

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