#66 Implementation error in ChannelSftp.setFilenameEncoding()

v1.0 (example)
open
nobody
None
5
2013-11-26
2013-11-26
momo
No

In method ChannelSftp.setFilenameEncoding() there is a version check that causes an error for any attempt to set a file name encoding on a server implementing SFTP protocol versions 3, 4 or 5.

Error #1:
Protocol version 3 doesn't define a default encoding so it is exactly that version I would require this functionality most.

Error #2:
I didn't find in the specs that SFTP protocol versions greater 3 are limited to UTF-8 encoding. As far as I understand it is just a default (RFC 2640: "pathnames ... SHOULD be ... UTF-8 encoded"). So if a server is configured to use any other encoding this functionality is still required.

It seems that error #1 has been introduced after the method has been implemented for the first time, at least the proposal in https://www.mail-archive.com/jsch-users@lists.sourceforge.net/msg00089.html only checks for a protocol version greater than 3.

Please completely remove the protocol version check from this method.

Cheers,
momo

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks