[Web-SIG] WSGI Amendments thoughts: the horror of charsets

Mark Hammond mhammond at skippinet.com.au
Mon Nov 17 03:36:21 CET 2008


> Python decodes the environ to its own copy (wrapped in os.environ) at
> interpreter startup time;

I don't think Python explicitly converts it - the CRT's ANSI version of environ is used, so the resulting strings should be encoded using the 'mbcs' encoding.  What mangling do you see?

> there's no way to query the real ‘live’
> environment that I know of. It'd require a C extension.

win32api and ctypes would both let you call the Windows API.

> What I'm saying is that neither Apache's nor IIS's behaviour can be
> considered clearly correct or wrong at this point, and there is no way
> a WSGI adapter living underneath them *can* fix up the differences.

What is IIS doing wrong here?  IIUC, ISAPI treats everything as bytes, so it is more likely to be the "higher-level" layers built on ISAPI (eg, ASP) which assume encodings.

Apologies if you have already answered any of these - I haven’t been following that closely...

Cheers,

Mark



More information about the Web-SIG mailing list