Sign in to follow this  
Followers 0
RaviJ

Issue with unicode characters

4 posts in this topic

#1 ·  Posted (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 by RaviJ

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Manadar

Share this post


Link to post
Share on other sites

Unicode-processing issues in Perl and how to cope with it ... Characters are Unicode characters.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0