Message9159

Author jeff.allen
Recipients jeff.allen, nullquery
Date 2014-10-17.20:08:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413576528.79.0.237748334114.issue2222@psf.upfronthosting.co.za>
In-reply-to
Content
I get this a lot when testing under Eclipse, but not at a real console. My usual solution is to add -Dpython.console.encoding=UTF-8 (or whatever) as a JVM parameter. But you can do it in the (Jython) registry too.

Jython's sys module looks in several places for the console encoding. If nothing tells it the encoding explicitly, it asks Java, here:
https://hg.python.org/jython/file/4ed64dc6c895/src/org/python/core/PySystemState.java#l829

Unfortunately, when Windows returns code page zero, Java claims to know that the encoding is cp0.
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/windows/native/java/io/Console_md.c#l61

Maybe we should convert that special case to null here, so that Jython will next consult file.encoding. I *think* this is what the outcome of CPython 6501 amounts to (http://bugs.python.org/issue6501).
History
Date User Action Args
2014-10-17 20:08:48jeff.allensetmessageid: <1413576528.79.0.237748334114.issue2222@psf.upfronthosting.co.za>
2014-10-17 20:08:48jeff.allensetrecipients: + jeff.allen, nullquery
2014-10-17 20:08:48jeff.allenlinkissue2222 messages
2014-10-17 20:08:47jeff.allencreate