From 4aca4e0a3125abeed07385c2166694a0880e0c28 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 12 Jan 2022 01:53:34 +0100 Subject: [PATCH] [errorprone] Fix implicit use of platform default charset Change-Id: I42f893c4248d8b00bf4aaf59cd528c43940f99e2 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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$ -- 2.39.5