java调用jython时的中文问题,急呀
test.py代码如下,非常简单
# -*- coding: utf-8 -*-
s = "中文"
print s
java代码如下,ExePythonFile.java
import org.python.util.PythonInterpreter;
public class ExePythonFile {
public static void main(String[] args) {
PythonInterpreter interp = new PythonInterpreter();
interp.execfile("D:/eclipse_platform_workspace/java/test.py");
}
}
运行ExePythonFile 时输出是乱码“涓枃”,请教给我应该怎么弄才能正确输入中文,py文件中我已经写了utf-8编码的。