Newbie question about text encoding

Chris Angelico rosuav at gmail.com
Tue Feb 24 10:03:16 EST 2015


On Wed, Feb 25, 2015 at 1:55 AM, Laura Creighton <lac at openend.se> wrote:
> 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"

Can you be sure it's Latin-1? I'm not certain of that. In any case, I
never advocate fixing encoding problems by "just do this and it'll all
go away"; you have to understand your data before you can decode it.

ChrisA



More information about the Python-list mailing list