unicode and hashlib

Scott David Daniels Scott.Daniels at Acm.Org
Sat Nov 29 13:23:33 EST 2008


Scott David Daniels wrote:
...
> If you now, and for all time, decide that the only source you will take 
> is cp1252, perhaps you should decode to cp1252 before hashing.

Of course my dyslexia sticks out here as I get encode and decode exactly
backwards -- Marc 'BlackJack' Rintsch has it right.

Characters (a concept) are "encoded" to a byte format (representation).
Bytes (a precise representation) are "decoded" to characters (a format
with semantics).

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list