Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从java调用shell脚本时将UTF-8字符作为参数传递_Java_Shell_Utf 8 - Fatal编程技术网

从java调用shell脚本时将UTF-8字符作为参数传递

从java调用shell脚本时将UTF-8字符作为参数传递,java,shell,utf-8,Java,Shell,Utf 8,我需要从java调用shell脚本,并将UTF-8字符作为参数传递(希伯来语/阿拉伯语字符) 但是这些角色都变成了?????在shell脚本中 我正在使用:Runtime.getRuntime().exec()调用shell脚本 和-Dfile.encoding=UTF-8,如果Java中的字符本身没有转换成?的话,你能提供你得到的代码和输出吗?可能是你没有将环境变量LANG=C.UTF-8传递给shell进程吗?你能详细说明一下:将环境变量LANG=C.UTF-8传递给shell进程吗输入代码

我需要从java调用shell脚本,并将UTF-8字符作为参数传递(希伯来语/阿拉伯语字符)

但是这些角色都变成了?????在shell脚本中

我正在使用:
Runtime.getRuntime().exec()
调用shell脚本


-Dfile.encoding=UTF-8
,如果Java中的字符本身没有转换成

的话,你能提供你得到的代码和输出吗?可能是你没有将环境变量LANG=C.UTF-8传递给shell进程吗?你能详细说明一下:将环境变量LANG=C.UTF-8传递给shell进程吗输入代码,并确保您的控制台接受UTF-8。@HiteshBajaj如果您不能信任您的控制台处理UTF-8,请改为写入文件并使用支持UTF-8的文件查看器打开。