mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 05:30:47 +00:00
Fixed: AS1/2 actions must use SWF charset when writing its length
This commit is contained in:
@@ -152,6 +152,17 @@ public class Utf8Helper {
|
||||
// todo: make it faster without actually writing it to an array
|
||||
return getBytes(string).length;
|
||||
}
|
||||
|
||||
public static int getBytesLength(String string, String charset) {
|
||||
if (charset.toLowerCase().equals(charsetName)) {
|
||||
return getBytesLength(string);
|
||||
}
|
||||
try {
|
||||
return string.getBytes(charset).length;
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
return 0; //Should not happen
|
||||
}
|
||||
}
|
||||
|
||||
private static String escapeInvalidUtf8Char(int v) {
|
||||
//Note: for writing the string "{invalid_utf8=xxx}" itself, you can escape it with "{+invalid_utf8=xxx}"
|
||||
|
||||
Reference in New Issue
Block a user