char 128? no... 256

Brian Quinlan brian at sweetapp.com
Wed Feb 12 14:26:42 EST 2003


> All of my devices can display the TradeMark symbol correctly.
> None of them can print the Unicode character 8482.

These two statements seem contradictory.

> I never use Unicode.

But you are using it in this case.

> The TradeMark symbol is being encoded to that Unicode value, 8482.
> I would like to decode that back to what I assume is iso-8859-1.
> However, encoding back to iso-8859-1 only allows characters under 
> 256.

So now you understand that what you want is impossible, right? That's
like saying that you want to convert a Japanese character to ASCII.

Your machine might be using the windows-1252 encoding. Try:

print unichr(8482).encode('windows-1252')

Cheers,
Brian






More information about the Python-list mailing list