Newbie question about text encoding

Laura Creighton lac at openend.se
Tue Feb 24 10:06:19 EST 2015


In a message of Tue, 24 Feb 2015 15:55:41 +0100, Laura Creighton writes:
>In a message of Tue, 24 Feb 2015 06:25:24 -0500, Dave Angel writes:
>>But utf-8 does not seem to be the right encoding for that bytestring. 
>>So you'll need a form like:
>>     mystring = rec.decode(encoding='xxx')
>>
>>for some value of xxx.
>
>>DaveA
>
>And the xxx you want is "latin1"
>
>Laura

er, latin1.  You don't want an extra set of quotes.
There are many aliases for latin1. i.e. latin_1, iso-8859-1, iso8859-1,
8859, cp819, latin, latin1, L1
see: https://docs.python.org/2.4/lib/standard-encodings.html

and you might want to read
https://docs.python.org/2/howto/unicode.html

to understand the problem better.

Laura



More information about the Python-list mailing list