Skip to content

Commit

Permalink
[fix] force utf-8 encoding in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
marmoure committed Oct 31, 2023
1 parent 4720420 commit 66a07ff
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import static java.nio.charset.StandardCharsets.UTF_8;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -87,7 +88,7 @@ public void transform(final InputStream content, final Path transformation, fina
final char buf[] = new char[4096];
int read = -1;
try(final Reader jsonReader = new StringReader(jsonResult);
final Writer writer = new OutputStreamWriter(result)) {
final Writer writer = new OutputStreamWriter(result, UTF_8)) {
while((read = jsonReader.read(buf)) > -1) {
writer.write(buf, 0, read);
}
Expand Down

0 comments on commit 66a07ff

Please sign in to comment.