]> source.dussan.org Git - jgit.git/commitdiff
[errorprone] Fix implicit use of platform default charset 81/189681/2
authorMatthias Sohn <matthias.sohn@sap.com>
Wed, 12 Jan 2022 00:53:34 +0000 (01:53 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 19 Jan 2022 08:54:37 +0000 (09:54 +0100)
Change-Id: I42f893c4248d8b00bf4aaf59cd528c43940f99e2

org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java

index d26842c641b25af0329e5b5aedad1d229e3a2e76..128881779bd8560616235ec48d7767840db0e0c0 100644 (file)
@@ -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$