From 475dcc2985f4792e54c4b39328b2ca442f2cbe7d Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 13 May 2017 18:01:18 +0200 Subject: [PATCH] [findBugs] Use UTF-8 when writing to the error stream in jgit pgm Change-Id: Ic2555ea932dbbd1a3a6868e731f247b9754d7f09 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java index 3addecb2f..a9f428e02 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java @@ -44,8 +44,11 @@ package org.eclipse.jgit.pgm; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.io.File; import java.io.IOException; +import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; @@ -192,7 +195,7 @@ public class Main { } PrintWriter createErrorWriter() { - return new PrintWriter(System.err); + return new PrintWriter(new OutputStreamWriter(System.err, UTF_8)); } private void execute(final String[] argv) throws Exception {