Open
Description
Implementation of JsonFormat.printToString() (which is in ProtobufFormatter.java) is to print to a byte array using the Charset specified by JsonFormat.setDefaultCharset(), but converts the byte array back to a string using ByteArrayOutputStream.toString(), which uses Charset.defaultCharset().
Conversion from the ByteArrayOutputStream back to a string, https://github.com/bivas/protobuf-java-format/blob/master/src/main/java/com/googlecode/protobuf/format/ProtobufFormatter.java#L91, should also use the specified Charset instead of JVM default.
It is worth pointing out that conversion to bytes and back to string is not actually required if all we want to do is serialize JSON to a java.lang.String.
Metadata
Metadata
Assignees
Labels
No labels