redpen-cc / redpen

RedPen is an open source proofreading tool to check if your technical documents meet the writing standard. RedPen supports various markup text formats (Markdown, Textile, AsciiDoc, Re:VIEW, reStructuredText and LaTeX).

Home Page:https://redpen.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);