>> Read it as a string, and then decode it with the .decode method. You
>> specify what encoding it's in.
>
> Most probably, the OP is asking what to do with an UTF-8 encoded string.
>
> To decode that, just use:
>
> s.decode("utf-8")
I prefer:
unicode(s, 'utf-8')
That way it's more clear that
Erik Max Francis wrote:
> Flags in the ID3 tag specify the encoding. It is not always UTF-8.
>
> http://www.id3.org/id3v2.4.0-structure.txt
Okay... Didn't know that, and I'm pretty sure with ID3V1 this was always
utf-8 in case it was unicode (which was a non-standard extension anyway).
Thanks fo
Heiko Wundram wrote:
> Most probably, the OP is asking what to do with an UTF-8 encoded string.
>
> To decode that, just use:
>
> s.decode("utf-8")
>
> to get a unicode string object.
Flags in the ID3 tag specify the encoding. It is not always UTF-8.
http://www.id3.org/id3v2.4.0-stru
Erik Max Francis wrote:
> Read it as a string, and then decode it with the .decode method. You
> specify what encoding it's in.
Most probably, the OP is asking what to do with an UTF-8 encoded string.
To decode that, just use:
s.decode("utf-8")
to get a unicode string object.
Example:
>>> s
John Morey wrote:
> I have a variable that contains a string which may or may not include
> unicode characters, I understand that I declare a unicode string like this
> u'whatever' , the question is that when that string is read in from
> an external source (in this case an id3 tag) how do I make