Message134948
| Author |
vstinner |
| Recipients |
Daniel.Goertzen, amaury.forgeotdarc, atuining, belopolsky, flox, grahamd, pitrou, vstinner |
| Date |
2011年05月01日.23:52:19 |
| SpamBayes Score |
9.536217e-09 |
| Marked as misclassified |
No |
| Message-id |
<1304293940.46.0.961727107077.issue6501@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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). |
|