- WinSCP utf8 autodetect with SFTP
- Thursday, July 16th, 2009 at 2:02:38pm MDT
- --- core/SftpFileSystem.cpp.old 2009-07-16 21:15:39.000000000 +0200
- +++ core/SftpFileSystem.cpp 2009-07-16 21:43:34.000000000 +0200
- @@ -134,6 +134,7 @@
- #define SFTP_EXT_SPACE_AVAILABLE "space-available"
- #define SFTP_EXT_CHECK_FILE "check-file"
- #define SFTP_EXT_CHECK_FILE_NAME "check-file-name"
- +#define SFTP_EXT_UTF8 "utf-8@fazekas.hu"
- //---------------------------------------------------------------------------
- #define OGQ_LIST_OWNERS 0x01
- #define OGQ_LIST_GROUPS 0x02
- @@ -2576,6 +2577,8 @@
- FSupport->Loaded = false;
- SAFE_DESTROY(FFixedPaths);
- + bool Utf8Hint = false;
- +
- if (FVersion >= 3)
- {
- while (Packet.GetNextData() != NULL)
- @@ -2721,6 +2724,11 @@
- (ExtensionData)));
- }
- }
- + else if (ExtensionName == SFTP_EXT_UTF8)
- + {
- + FTerminal->LogEvent("Server is using UTF-8 filenames");
- + Utf8Hint = true;
- + }
- else
- {
- FTerminal->LogEvent(FORMAT("Unknown server extension %s=%s",
- @@ -2765,7 +2773,7 @@
- FUtfStrings =
- (FTerminal->SessionData->Utf == asOff) ||
- ((FTerminal->SessionData->Utf == asAuto) &&
- - (FVersion >= 4) && !FUtfNever);
- + ((FVersion >= 4) || Utf8Hint) && !FUtfNever);
- if (FUtfStrings)
- {
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.