diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d32fc32..5960fa493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,6 @@ All notable changes to this project will be documented in this file. - ABC Explorer tool - FLA export - remember last selected FLA version/compression - AS3 Natural sorting of packages and script -- AS3 P-code - Escape unicode characters in namespaces (for example in api-versioned files) ### Fixed - [#2043] StartSound2 tag handling diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index 3dfa95972..5d0d75a3e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -269,8 +269,19 @@ public class Multiname { break; } } + String versionAdd = ""; + if (name != null && name.length() > 0) { + char lastChar = name.charAt(name.length() - 1); + + if (lastChar >= Namespace.MIN_API_MARK && lastChar <= Namespace.MAX_API_MARK) { + name = name.substring(0, name.length() - 1); + versionAdd = String.format("\\u%04x", (int) lastChar); + } + } + + return constants.getNamespace(index).getKindStr() + "(" + (name == null ? "null" : "\"" + - Helper.escapePCodeEnglishString(name) //Note: Versioned ABC files have high unicode characters in namespaces, escape them + Helper.escapePCodeString(name) + versionAdd + "\"") + (sub > 0 ? ",\"" + sub + "\"" : "") + ")"; }