Detect UTF-8 with SFTP version 3

Advertisement

Cus
Guest

Detect UTF-8 with SFTP version 3

Currently OpenSSH, the most commonly used sftp-server implementation only supports SFTP protocol version 3. This version has a serious problem: the character encoding of the filenames is unspecified with it. It would be very useful if one could add a tiny (no more than a few lines) patch to openSSH and with that patch, the sftp-server could give a hint to WinSCP (and other sftp clients) to use UTF-8 filenames. (The current behavior of WinSCP is not to use UTF8 if sftp protocol version is less than 4 or if it's not explicitly requested in the session configuration dialog)

Probably the simplest way to achieve this is to use a custom extension to sftp. Below is a tiny patch to WinSCP that detects this custom extension, and sets the encoding to utf8 when utf8 setting is configured to Auto.

<invalid hyperlink removed by admin>

If anybody has a better idea to make WinSCP detect utf8 filenames even with openSSH, let me know. Asking the users every time to set the UTF-8 setting to "On" is not very user-friendly, the majority of my users don't even know what utf-8 is, they just want things to work :)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Detect UTF-8 with SFTP version 3

I understand your concerns. If the extension gets to OpenSSH or any fork of it, I'm happy to add support for it to WinSCP.

Reply with quote

Guest

Re: Detect UTF-8 with SFTP version 3

I was afraid you say that :). Anyway, I will ask the OpenSSH developers, and report back.

Reply with quote

Advertisement

You can post new topics in this forum