开发者

Execute unicode command from script on Windows

I need to execute a command like vlc 舨.avi programatically on Windows. When done directly in cmd.exe this works just fine, proving that VLC has the capability to recognize unicode arguments. Howeve开发者_如何学JAVAr, I'm having trouble putting this in a script and having it work.

Has anyone done this successfully? I would love to do this in Ruby (I have 1.9.2) but Python-win32, Perl-win32, batch, .cmd, VB/W/JScript are all options. Target O/Ses are XP and Vista.


It's most likely an encoding issue.

Encoding in command prompts and in windows is not always the same. If your script in Notepad, then execute it, you may end up with the filename being converted to unicode differently hence the error.

Somehow, you'll have to make sure that the encoding is correct, maybe by saving you batch file as Unicode text file? Would that work?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜