NativeProcessStartupInfo.arguments escaping issue
Hi,
I've been using the NativeProcess class to call Java to calculate an MD5 hash of (large) files by passing File.nativePath as one of the arguments. When the file name has some strange character in it like "" (3 bytes: [EF][80][A0]), this character seems to be transformed by the escaping of NativeProcessStartupInfo.arguments to "?".
The NativeProcessStartupInfo.arguments documentation states: "AIR automatically escapes any characters in the string that need to be escaped (such as space characters)." It seems to me that the escaping goes a little bit too far and escapes characters that shouldn't be escaped.
As a work-around I am Base64 encoding the path before I use it as an argument to pass to Java. In Java I decode the path and all works as expected.
I'm using AIR 2.5, below is a code snippet of how I make the call to Java:
var args:Vector.<String> = new Vector.<String>();
args.push("-cp");
args.push("path to jar");
args.push("class to execute");
args.push("filePath");
var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();
info.executable = [javaLocation];
info.arguments = args;
javaProcess = new NativeProcess();
[adding all listeners...]
javaProcess.start(info);
Has anyone else encountered this problem? Is this considered expected behavior?
Cheers,
Wijnand
