data encoding for Python COM interface

Max Ischenko max at ucmg.com.ua.remove.it
Mon Sep 29 07:27:06 EDT 2003


I've wrote a COM Server (in python) to be used from .ASP pages (in VB).
All work fine except data encoding. I need to pass Latin1 characters 
(with Umlauts) through the COM interface.

If i simply pass my unicode data as is through the COM interface I got 
no errors but Umlauts simply disappears on the web pages (ae becomes a).

If I do encode my data in 'iso8859-1' in COM Server
I got this error while evaluating .ASP page:
Python COM Server Internal Error (0x80004005)
Unexpected Python Error: exceptions.UnicodeDecodeError: 'ascii' codec 
can't decode byte 0xe4 in position 16: ordinal not in range(128)
somepage.asp, line 33.
Note, however that test python COM client able to read and save data in 
utf-8 encoding and it is displayed correctly (via NotePad).

Error ... 'ascii' codec ... makes me suspect that I could (or should) 
somehow specify the correct codec for my COM interfaces.

tia.





More information about the Python-list mailing list