process.popen with Japanese args => UTF8 JAVA

Jun Tanaka tnajun at
Sun Mar 9 08:52:58 CET 2014


I have tried to process.popen to run java program with Japanese language. is compiled with utf8
'日本語' below means Japanese in Japanese.
but it does not work. Anyone who knows this matter well. Please help.


>>>>>>>>python code>>>>>>>>>>>>>
sentence = '日本語'
filename = 'japanese'
java_file = 'test'
cmd = "java {0} {1} {2}".format(java_file, sentence, filename)
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
>>>>>>>>python code end>>>>>>>>>>>>>>>>>>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list