diff --git a/build.xml b/build.xml
index db4a47588..94fc8df40 100644
--- a/build.xml
+++ b/build.xml
@@ -395,7 +395,7 @@
-
+
-Djava.net.preferIPv4Stack=true
-Djna.nosys=true
@@ -444,7 +443,7 @@
-
+ -->
@@ -487,18 +486,18 @@
-
-
+
+
-
-
+
+
diff --git a/resources/ffdec.exe b/resources/ffdec.exe
new file mode 100644
index 000000000..d323c08df
Binary files /dev/null and b/resources/ffdec.exe differ
diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java
index 483530f2a..500f30903 100644
--- a/src/com/jpexs/decompiler/flash/gui/Main.java
+++ b/src/com/jpexs/decompiler/flash/gui/Main.java
@@ -107,6 +107,7 @@ import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
+import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.nio.file.FileSystems;
import java.nio.file.StandardWatchEventKinds;
@@ -2649,11 +2650,28 @@ public class Main {
}
}
+ /**
+ * To bypass wrong encoded unicode characters coming from EXE,
+ * it Launch5j encodes characters using URLEncoder.
+ * @param args
+ */
+ private static void decodeLaunch5jArgs(String[] args) {
+ String encargs = System.getProperty("l5j.encargs");
+ if ("true".equals(encargs) || "1".equals(encargs)) {
+ for (int i = 0; i < args.length; ++i) {
+ try {
+ args[i] = URLDecoder.decode(args[i], "UTF-8");
+ } catch (Exception e) { }
+ }
+ }
+ }
+
/**
* @param args the command line arguments
* @throws IOException On error
*/
public static void main(String[] args) throws IOException {
+ decodeLaunch5jArgs(args);
setSessionLoaded(false);
clearTemp();
@@ -2686,7 +2704,7 @@ public class Main {
reloadLastSession();
}
});
- } else {
+ } else {
checkLibraryVersion();
setSessionLoaded(true);
String[] filesToOpen = CommandLineArgumentParser.parseArguments(args);