You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "devlhl (via GitHub)" <gi...@apache.org> on 2023/06/02 02:23:20 UTC
[GitHub] [mina-sshd] devlhl opened a new issue, #388: ScpClient with ScpModuleProperties.SCP_OUTGOING_ENCODING.set(sshClient, Charset.forName("GBK")) does not effect
devlhl opened a new issue, #388:
URL: https://github.com/apache/mina-sshd/issues/388
### Version
master
### Bug description
1) fist, the sftp server has tow types of charset file(file name charset:UTF-8、GBK)and all contains Chinese character.
2) the sftp server default LANG is UTF-8,so the file with UTF-8 is OK and the file with GBK is display garbled code
3) because `sftpClient.setNameDecodingCharset(Charset.forName("GBK"));` SftpClient can correctly read display garbled code file
SftpClient sftpClient = factory.createSftpClient(session).singleSessionInstance();
sftpClient.setNameDecodingCharset(Charset.forName("GBK"));
System.out.println(sftpClient.stat("xxx/xxx_中文字符.pdf").isRegularFile());
4) however, regardless of whether encoding is set or not, the ScpClient cannot work well same as SftpClient
ScpModuleProperties.SCP_OUTGOING_ENCODING.set(sshClient, Charset.forName("GBK")); // or not
ScpClientCreator creator = ScpClientCreator.instance();
ScpClient scpClient = creator.createScpClient(session);
scpClient = CloseableScpClient.singleSessionInstance(scpClient);
scpClient.download("xxx/xxx_中文字符.pdf", "src/main/resources/");
5) i find the code org.apache.sshd.client.channel.ChannelExec#doOpen
buffer.putString(command); // this command has the file name with Chinese character and it use default UTF-8 with getBytes
### Actual behavior
ScpClient cannot read files with non UTF-8 encoded file names
### Expected behavior
ScpClient want read files with non UTF-8 encoded file names
### Relevant log output
_No response_
### Other information
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
[GitHub] [mina-sshd] tomaswolf closed issue #388: ScpClient with ScpModuleProperties.SCP_OUTGOING_ENCODING.set(sshClient, Charset.forName("GBK")) does not effect
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #388: ScpClient with ScpModuleProperties.SCP_OUTGOING_ENCODING.set(sshClient, Charset.forName("GBK")) does not effect
URL: https://github.com/apache/mina-sshd/issues/388
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org