Unicode escape only API mark in namespaces.

This commit is contained in:
Jindra Petřík
2023-10-01 17:46:28 +02:00
parent d37d7138c9
commit 306419b93b
2 changed files with 12 additions and 2 deletions

View File

@@ -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

View File

@@ -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 + "\"" : "") + ")";
}