Kanji is not displayed correctly in Formatter
marron9999 opened this issue · comments
In redpen/redpen-core/src/main/java/cc/redpen/formatter/Formatter.java
ByteArrayOutputStream baos = new ByteArrayOutputStream();
:
format(new PrintWriter(baos), docErrorsMap);
:
return new String(baos.toByteArray(), StandardCharsets.UTF_8);
I think it depends on the default character encoding of PrintWriter.
And, should use OutputStreamWriter.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(baos, StandardCharsets. UTF _ 8)
:
format(new PrintWriter(osw), docErrorsMap);
:
return new String(baos.toByteArray(), StandardCharsets.UTF_8);