Jython で Python コードを実行しようとしていますが、このコードにはいくつかの Unicode リテラルが含まれています。コードを (ファイルからロードするのではなく) 文字列として渡したいと思います。
exec() メソッドを呼び出すと、Unicode 文字が「?」に変換されるようです。文字:
PythonInterpreter interp = new PythonInterpreter(null, new PySystemState());
System.out.println("ā".codePointAt(0)); // outputs 257
interp.exec("print ord(\"ā\")"); // outputs 63
これらの文字を台無しにすることなく、文字列をインタープリターに渡す方法を見つけることができないようです。