Treating a unicode string as latin-1

Paul Hankin paul.hankin at gmail.com
Thu Jan 3 08:40:25 EST 2008


On Jan 3, 1:31 pm, Simon Willison <si... at simonwillison.net> wrote:
> How can I tell Python "I know this says it's a unicode string, but I
> need you to treat it like a bytestring"?

u'Bob\x92s Breakfast'.encode('latin-1')

--
Paul Hankin



More information about the Python-list mailing list