django を使用する場合、http://myhost/XXX/testIndex で呼び出すことができるメソッドを記述します。
def testIndex(request):
res = os.system('java -jar test.HelloWorld' > /tmp/log)
... ...
HelloWorld Java は次のとおりです。
public class HelloWorld {
public static void main(String[] args) throws IOException {
System.out.println("hello!");
System.out.println("你好!");
}
http:// myhost/XXX/testIndex にアクセスして /tmp/log ファイルを開くと、UTF-8 文字が正しくありません。このような
hello! ??!
どうしたの ?ところで、私はLinux centOSの下にいます