char 128? no... 256

Afanasiy abelikov72 at hotmail.com
Wed Feb 12 10:50:53 EST 2003


On Wed, 12 Feb 2003 03:18:43 GMT, Afanasiy <abelikov72 at hotmail.com> wrote:

>UnicodeError: ASCII encoding error: ordinal not in range(128)
>
>This isn't even unicode, it's extended ascii characters used in foreign
>languages. I can't print them, or write them to file, etc... They are
>normal chars. This really annoying, a str() around it doesn't even work.

Ok, though it doesn't matter I will tell you I am using MSSQL through ADO.
People will now tell I should not be using those and I will ignore them.

Now, even encoding the 'latin-1', 8 bit, is problematic, because symbols
which are 8 bit in Windows, such as the TradeMark symbol will not encode
into 8 bit, as the ordinal value in the Unicode object is 8482.

This is hex 99 on a plain Windows 2000 install, I presume 'latin-1'.
(Which is iso-8859-1 afaik) This will show up in webpages designated :

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

This will show up in notepad... and in my non-unicode text editors.

It always shows up as the TradeMark symbol.

So how would I encode this Unicode character, 8482 so that it would
show up as a TradeMark symbol on Windows 2000 machines. Windows 2000
can display a TradeMark symbol in non Unicode applications.




More information about the Python-list mailing list