RaviJ Posted November 12, 2010 Share Posted November 12, 2010 (edited) Hi, I am passing unicode character from java to autoIt script as : String filePath = "E:\\ravi\\腿哦哦予以.ppt"; System.out.println(filePath); String exeFile = "SingleFileUpload.exe"; //autoIt script dialog = new String[]{ exeFile,"ie",filePath }; Runtime.getRuntime().exec(dialog); But when i access filePath parameter from autoIt script, i am getting as ???? instead of correct value of parameter. MsgBox(0, "File Path:", $CmdLine[2]) ControlSetText($title,"","Edit1", $CmdLine[2]) Getting E:\ravi\????.ppt as value of $CmdLine[2] which is filePath Thanks, Ravi Edited November 12, 2010 by RaviJ Link to comment Share on other sites More sharing options...
Bhima Posted November 12, 2010 Share Posted November 12, 2010 Hi Ravi, Just go through this page http://www.scintilla.org/SciTEDoc.html and you will find some settings which will do the work. I have done some settings change and looks like things are getting done. Thank you, Bhima Link to comment Share on other sites More sharing options...
jvanegmond Posted November 12, 2010 Share Posted November 12, 2010 (edited) Exactly the same issue as yours in a Java bug report: http://bugs.sun.com/view_bug.do?bug_id=4947220 From that page: Here's the source for the workaround as mentioned by sdaw: String[] cmd = new String[]{"yourcmd.exe","Japanese CLI argument: \ufeff\u30cb\u30e5\u30fc\u30b9"}; Map<String, String> newEnv = new HashMap<String, String>(); newEnv.putAll(System.getenv()); String[] i18n = new String[cmd.length + 2]; i18n[0] = "cmd"; i18n[1] = "/C"; i18n[2] = cmd[0]; for (int counter = 1; counter < cmd.length; counter++) { String envName = "JENV_" + counter; i18n[counter + 2] = "%" + envName + "%"; newEnv.put(envName, cmd[counter]); } cmd = i18n; ProcessBuilder pb = new ProcessBuilder(cmd); Map<String, String> env = pb.environment(); env.putAll(newEnv); final Process p = pb.start(); Edited November 12, 2010 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
canny Posted December 18, 2010 Share Posted December 18, 2010 Unicode-processing issues in Perl and how to cope with it ... Characters are Unicode characters. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now