Subject: 回复: Does libssh2 sftp support setting filename-charset?

回复: Does libssh2 sftp support setting filename-charset?

From: 许 瑞强 <>
Date: Thu, 13 Jun 2019 04:05:36 +0000

I tried according to your suggestion, indeed, the file name can be displayed normally.
Thanks again for your guidance. 😁

发件人: libssh2-devel <> 代表 Alexander Lamaison <>
发送时间: 2019年6月12日 18:15
收件人: development, libssh2
主题: Re: Does libssh2 sftp support setting filename-charset?

It does not. You have to know the charset used on the remote side and decode accordingly. The version of sftp that libssh2 supports just transfers filenames as a bag of bytes. Just like OpenSSH

On Wed, 12 Jun 2019, 10:47 许 瑞强, <<>> wrote:
Hi list.

Using the libssh2 sftp API I can successfully manipulate the files of the remote host, but I have a problem, the file name of the remote host is not UTF-8 encoding. When I use the API to get the file list, I get garbled, I read RFC: draft-ietf-secsh-filexfer-13.txt<> s6, see sftp can set filename-charset, I would like to ask everyone, does libssh2 sftp API supports the setting of filename-charset, if supported, how to set? I use the xftp tool to test, it is able to set the encoding, and correctly display the file name.
Anyone can help me ?

thank you all.

Received on 2019-06-13