diff --git a/src/main/java/com/googlecode/protobuf/format/ProtobufFormatter.java b/src/main/java/com/googlecode/protobuf/format/ProtobufFormatter.java index 95288f3..d70594f 100644 --- a/src/main/java/com/googlecode/protobuf/format/ProtobufFormatter.java +++ b/src/main/java/com/googlecode/protobuf/format/ProtobufFormatter.java @@ -88,7 +88,7 @@ public String printToString(final Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); print(message, out, defaultCharset); out.flush(); - return out.toString(); + return out.toString(defaultCharset.name()); } catch (IOException e) { throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).", e); @@ -103,7 +103,7 @@ public String printToString(final UnknownFieldSet fields) { ByteArrayOutputStream out = new ByteArrayOutputStream(); print(fields, out, defaultCharset); out.flush(); - return out.toString(); + return out.toString(defaultCharset.name()); } catch (IOException e) { throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).", e);