Closed
Description
Created by: ratchetfreak
java.lang.String.getBytes() relies on the default charset which is not necessarily consistent between instances. This should be fixed to a portable standard charset
public String readString() {
byte b[] = readBytes();
if (b == null) return null;
return new String(b, StandardCharset.UTF_8); // or whatever charset you want to fix it to
}
public void write(String data) {
write(data.getBytes(StandardCharset.UTF_8)); // must match readString
}
Metadata
Metadata
Assignees
Labels
No labels