fix UTF-8 decoding

This commit is contained in:
REAndroid
2023-01-16 11:51:01 -05:00
parent a5d71a28a4
commit 7455e35bef

View File

@ -184,6 +184,9 @@ public class StringItem extends BlockItem implements JSONConvert<JSONObject> {
CharBuffer charBuffer=charsetDecoder.decode(buf);
return charBuffer.toString();
} catch (CharacterCodingException ex) {
if(isUtf8){
return new String(allStringBytes, offLen[0], offLen[1], StandardCharsets.UTF_8);
}
return new String(allStringBytes, offLen[0], offLen[1], StandardCharsets.UTF_16LE);
}
}