Hi,

I'm using Karaf 4.2.1 on environments which doesn't have a UTF-8 encoding for 
instance Windows 10 or AIX with ISO-8859-1 encoding.
When I open a SSH session with the "client" script or with another SSH client, 
the non-ascii characters are not displayed correctly.
For instance the result of the "bundle:list" command prints "?" instead of "|" :

karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID ? State  ? Lvl ? Version ? Name
?????????????????????????????????????????????????????????????????????????
23 ? Active ?  80 ? 4.2.1   ? Apache Karaf :: OSGi Services :: Event

After some investigations I have found that the class 
org.apache.karaf.shell.ssh.SshTerminal has a hard coded UTF-8 value in its 
constructor :

public SshTerminal(Environment environment, InputStream input, OutputStream 
output) throws IOException {
     super("Karaf SSH terminal",
            environment.getEnv().get(Environment.ENV_TERM),
            input,
            output,
            StandardCharsets.UTF_8);

I have replaced StandardCharsets.UTF_8 with null and when running Karaf with 
this modification, I do not have the character issue anymore.

Do you think it is a valid correction ? I can open a jira ticket if you want.

Regards,
--
Nicolas Dutertry

Reply via email to