From: Matthias Sohn Date: Wed, 12 Jan 2022 00:53:34 +0000 (+0100) Subject: [errorprone] Fix implicit use of platform default charset X-Git-Tag: v6.1.0.202202221755-m3~68 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F189681%2F2;p=jgit.git [errorprone] Fix implicit use of platform default charset Change-Id: I42f893c4248d8b00bf4aaf59cd528c43940f99e2 --- diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java index d26842c641..128881779b 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java @@ -16,6 +16,7 @@ import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.text.MessageFormat; import java.util.List; import java.util.Map; @@ -188,7 +189,8 @@ class DiffTool extends TextBuiltin { outw.println(MessageFormat.format(CLIText.get().diffToolLaunch, fileIndex, fileCount, fileName, toolNamePrompt)); outw.flush(); - BufferedReader br = new BufferedReader(new InputStreamReader(ins)); + BufferedReader br = new BufferedReader( + new InputStreamReader(ins, StandardCharsets.UTF_8)); String line = null; if ((line = br.readLine()) != null) { if (!line.equalsIgnoreCase("Y")) { //$NON-NLS-1$