在windows中为ant的build.xml中指定带有日语字符的目录
我有一个 build.xml 文件,它指定一个包含日语字符的目录作为命令的参数。
<exec executable="${amxmlc_cmd}">
<arg line="${amxmlc_opt}" />
...
<arg line="-source-path+=Work/システム/_config_as" />
...
</exec>
我收到
<condition property="amxmlc_cmd" value="cmd.exe">
<os family="windows" />
</condition>
<condition property="amxmlc_opt" value='/c "${flex_sdk}bin/amxmlc"'>
<os family="windows" />
</condition>
错误“错误:无法打开 'Work/????/_config_as”
我更改为
<condition property="amxmlc_opt" value='/u/c "${flex_sdk}bin/amxmlc"'>
<os family="windows" />
</condition>
但我收到相同的错误。
当我将 Windows 非 unicode 程序默认更改为日语时,出现错误“错误:无法打开 'Work/shisutemu/_config_as'”
非常感谢任何帮助。 感谢您的提前。
I have a build.xml file that specify a directory with Japanese characters as an argument to a command.
<exec executable="${amxmlc_cmd}">
<arg line="${amxmlc_opt}" />
...
<arg line="-source-path+=Work/システム/_config_as" />
...
</exec>
Where
<condition property="amxmlc_cmd" value="cmd.exe">
<os family="windows" />
</condition>
<condition property="amxmlc_opt" value='/c "${flex_sdk}bin/amxmlc"'>
<os family="windows" />
</condition>
I get the error "Error: unable to open 'Work/????/_config_as"
I changed to
<condition property="amxmlc_opt" value='/u/c "${flex_sdk}bin/amxmlc"'>
<os family="windows" />
</condition>
But I get the same error.
When I changed the windows non-unicode program default to Japanese I got the error "Error: unable to open 'Work/システム/_config_as'"
Any help is greatly appreciated.
Thanks for advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是 ant,它没有正确传递 Unicode 参数。
仅当您将系统区域设置设置为日语并重新启动时,它才会起作用。
http://mihai-nita.net/ 2005/06/11/setting-the-user-and-system-locales/
===
更正:做了一些测试,这不是ant的错,而是Java本身的错。
我尝试过 Runtime.exec 和 ProcessBuilder.start,它们似乎都将参数转换为 ANSI,然后再将其传递给子应用程序。
(子应用程序是 C、Unicode,并从 C 父应用程序、Unicode 调用,工作正常)
相当蹩脚,2011 年(Java 版本 1.6.0_26-b03,在 7 中尝试会很有趣)
That is ant, who is not passing properly the Unicode parameters.
It will only work if you set the system locale to Japanese and reboot.
http://mihai-nita.net/2005/06/11/setting-the-user-and-system-locales/
===
Correction: did some testing, and it is not ant's fault, it is Java itself.
I have tried both Runtime.exec and ProcessBuilder.start, and both of them seem to convert the parameters to ANSI before passing it to the child application.
(the child app was C, Unicode, and called from a C parent, Unicode, worked fine)
Pretty lame, for 2011 (Java build 1.6.0_26-b03, it would be interesting to try in 7)