[python-win32] UnicodeEncodeError getting Query String Data from ActiveX Scripting engine in classic asp

2011-06-30 Thread Chris Lambacher
Hi, I am embedding python code into an existing legacy classic asp application. I need to access utf-8 encoded unicode query string data from python. I have something along the lines of (simplified): # have set in IIS7 ASP configuration for default session code page to be CodePage = 65001 a = u

Re: [python-win32] UnicodeEncodeError getting Query String Data from ActiveX Scripting engine in classic asp

2011-06-30 Thread Chris Lambacher
Hi again, Decided to try something that I was thinking about from reading the code for __str__ in win32com\client\dispatch.py If I bypass the __str__ method by using unicode against __call__() I get some success. # Next line works Response.Write(unicode(Request('ErrMsg').__call__())) #next line

Re: [python-win32] UnicodeEncodeError getting Query String Data from ActiveX Scripting engine in classic asp

2011-06-30 Thread Mark Hammond
On 1/07/2011 12:57 PM, Chris Lambacher wrote: ... Maybe there should be a __unicode__ method on the class? Maybe __str__ should set an explicit encoding? Something like: def __unicode__(self): try: return unicode(self.__call__())