karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: Karaf SSH invalid encoding
Date Fri, 09 Nov 2018 04:42:39 GMT
Hi Nicolas,

Let me check but AFAIR, null should use the default term encoding of the
system.

Regards
JB

On 08/11/2018 14:20, DUTERTRY Nicolas wrote:
> 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
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message