From 43a38d314433e6f4f1345d793cb418157849765c Mon Sep 17 00:00:00 2001 From: pyxide Date: Mon, 9 Jan 2017 18:07:17 +0100 Subject: [PATCH] Console encoding only when interactive --- pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java index 320c97bd1e..dbb9074148 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -78,7 +78,6 @@ public class Formatter { if (toConsole) { s = getConsoleEncoding(); if (null == s) { - // highly unlikely. s = System.getProperty("file.encoding"); } } @@ -215,8 +214,9 @@ public class Formatter { } catch (IllegalAccessException e) { // fall-through } + return getNativeConsoleEncoding(); } - return getNativeConsoleEncoding(); + return null; } private static String getNativeConsoleEncoding() {