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

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

From: 许 瑞强 <xu.ruiqiang_at_outlook.com>
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 <libssh2-devel-bounces_at_cool.haxx.se> 代表 Alexander Lamaison <swish_at_lammy.co.uk>
发送时间: 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 许 瑞强, <xu.ruiqiang_at_outlook.com<mailto:xu.ruiqiang_at_outlook.com>> 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<http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/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.
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2019-06-13