Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kanji is not displayed correctly in Formatter #885

Open
marron9999 opened this issue Dec 14, 2020 · 0 comments
Open

Kanji is not displayed correctly in Formatter #885

marron9999 opened this issue Dec 14, 2020 · 0 comments

Comments

@marron9999
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant