开发者

how to handle different language in file/folder path

I have written an application which takes folder path and perform some operation. But if folder path contains charac开发者_C百科ters of language other than English then it is not working. It only support English characters. How to handle this problem?


Theoretically it should work. Practically in most cases it is a problem of passing parameters from shell to java application. Try to verify that this works correctly: run application from command prompt exactly as you are doing but with remote debugging. Create breakpoint in your code where you are reading the parameter and see what is the value. I believe that the value is corrupted at this phase. This is a typical problem if you are on windows.

In this case you have to configure your system to support unicode characters in command prompt correctly.

If the path is read correctly from command line try to continue debugging and see where it is broken. Check which separator are you using. Avoid using both / and \, use File.separator instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜