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

Mark Hammond mhammond at skippinet.com.au
Sat Jul 1 02:22:40 CEST 2006


> I thought I would be able to do
>
> my_string = unicode(Request("formstring"),"ISO-8859-1")
>
> But i get:
> coercing to Unicode: need string or buffer, instance found.
> I'm guessing (and I mean guessing) this is because the CDispatch
> object doesn't have a __unicode__ function.

A __unicode__ function may well help there - but alternatively, you should
find that something like Request("formstring").Value (or similar) will give
you the unicode string.  I'm afraid I can't recall exactly what the Request
method returns in that case, so .Value is a guess...

Cheers,

Mark




More information about the Python-win32 mailing list