[python-win32] Python/ASP Request data with non ascii characters

Emlyn Jones emlynj at gmail.com
Wed Jul 5 23:31:16 CEST 2006


On Tuesday 04 Jul 2006 04:07, you wrote:
> > Hi Mark, thanks for the reply. The attribute you where
> > thinking off is `Item`.
> > What I'll need to work out now is which code page has been used to
> > encode that Unicode string.
>
> I'm not sure that is relevant.  If I understand correctly, the code-page is
> only used when converting from a string of 8-bit characters into Unicode.
> Once the string is represented as unicode characters, the code page isn't
> relevant.
Hi Mark,

For my own internal storage that's correct, I can just leave it as Unicode (as 
long as I read it back as unicode and send it to the browser as unicode).
I need to pass it on to a third party app though and that isn't unicode aware 
(yet). I've found a few solutions, none directly relevant to Python. In the 
interests of completeness however...
Firefox and IE will populate a hidden field called _charset_ on the form with 
the encoding used to submit the form. I can also "hope" that the form is 
submitted back in the same encoding it was sent (although the user can change 
that).

Cheers,
Emlyn.


More information about the Python-win32 mailing list