Message134948
> On a Western Windows, I suggest
> PYTHONIOENCODING=cp1252:backslashreplace
Why using this very small charset whereas a web server can use UTF-8?
I don't think that using backslashreplace on stdout is a good idea.
> But
> PYTHONIOENCODING=mbcs
> is also OK, except that characters outside the Windows code
> page will be replaced with '?'
Starting at Python 3.2, you should use mbcs:replace to replace unencodable characters by '?'. The strict error handler is now strict: it raises a UnicodeEncodeError if a character is not encodable to mbcs.
Note: mbcs is the ANSI code page.
--
Using device_encoding.patch, I suppose that sys.std* streams will use the ANSI code page (mbcs, which is the code page 1252 on a Western Windows setup) in grahamd's usecase (Python program running in Apache). |
|
Date |
User |
Action |
Args |
2011-05-01 23:52:20 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc, atuining, belopolsky, pitrou, grahamd, flox, Daniel.Goertzen |
2011-05-01 23:52:20 | vstinner | set | messageid: <1304293940.46.0.961727107077.issue6501@psf.upfronthosting.co.za> |
2011-05-01 23:52:19 | vstinner | link | issue6501 messages |
2011-05-01 23:52:19 | vstinner | create | |
|