我用Jython 2.5.1编写了一个程序,它在我的windows7机器上运行得很好,但是在一台日本机器上,它抛出了一个异常:“unknown encoding‘ms932’”
我发现编解码器.java是唯一打印未知编码“xyz”消息的模块
此文件加载别名.py其中包含
# cp932 codec
'932' : 'cp932',
'ms932' : 'cp932',
'mskanji' : 'cp932',
'ms_kanji' : 'cp932',
文件cp932.py包含
^{pr2}$但是。。_编解码器不存在as is also discussed in this page 有人知道从这里到哪里去吗?在
您应该使用
sys.setdefaultencoding
,即或者干脆把
^{pr2}$在你剧本的开头。在
http://docs.python.org/library/sys.html
这是Jython Bugs问题#1066:
http://bugs.jython.org/issue1066
日语博客和其他什么都不推荐以下内容,对我也很有用:
用参数
-C utf-8
调用jython。在请注意,显然仍然存在一些限制,例如无法访问日语路径名或将日语打印到控制台。我没有遇到过这些问题,所以我不能对解决方法发表评论。在
相关问题 更多 >
编程相关推荐