From ccf3351b51bbaf8b342680c878ff01746fda9060 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 12 Dec 2012 14:54:33 -0800 Subject: [PATCH] improved SSH usage compatibility --- core/src/main/java/hudson/cli/CLICommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 2e9f5bec74..c5a672ff40 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -365,6 +365,11 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { } protected Charset getClientCharset() throws IOException, InterruptedException { + if (channel==null) + // for SSH, assume the platform default encoding + // this is in-line with the standard SSH behavior + return Charset.defaultCharset(); + String charsetName = checkChannel().call(new GetCharset()); try { return Charset.forName(charsetName); -- GitLab