Added #116 Show invalid utf-8 bytes in Strings as {invalid_utf8:xxx}

This commit is contained in:
Jindra Petřík
2023-10-16 09:36:06 +02:00
parent 98b7ac100e
commit b6e8ca0d67
7 changed files with 162 additions and 7 deletions
@@ -34,6 +34,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Traits;
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
import com.jpexs.decompiler.flash.dumpview.DumpInfoSpecial;
import com.jpexs.decompiler.flash.dumpview.DumpInfoSpecialType;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.MemoryInputStream;
import com.jpexs.helpers.utf8.Utf8Helper;
import java.io.ByteArrayOutputStream;
@@ -523,8 +524,8 @@ public class ABCInputStream implements AutoCloseable {
stringDataBuffer = new byte[newLength];
}
safeRead(length, stringDataBuffer);
String r = new String(stringDataBuffer, 0, length, Utf8Helper.charset);
safeRead(length, stringDataBuffer);
String r = Utf8Helper.decode(stringDataBuffer, 0, length);
endDumpLevel(r);
return r;
}