Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

WinSCP utf8 autodetect with SFTP
Thursday, July 16th, 2009 at 2:02:38pm MDT 

  1. --- core/SftpFileSystem.cpp.old 2009-07-16 21:15:39.000000000 +0200
  2. +++ core/SftpFileSystem.cpp     2009-07-16 21:43:34.000000000 +0200
  3. @@ -134,6 +134,7 @@
  4.  #define SFTP_EXT_SPACE_AVAILABLE "space-available"
  5.  #define SFTP_EXT_CHECK_FILE "check-file"
  6.  #define SFTP_EXT_CHECK_FILE_NAME "check-file-name"
  7. +#define SFTP_EXT_UTF8 "utf-8@fazekas.hu"
  8.  //---------------------------------------------------------------------------
  9.  #define OGQ_LIST_OWNERS 0x01
  10.  #define OGQ_LIST_GROUPS 0x02
  11. @@ -2576,6 +2577,8 @@
  12.    FSupport->Loaded = false;
  13.    SAFE_DESTROY(FFixedPaths);
  14.  
  15. +  bool Utf8Hint = false;
  16. +
  17.    if (FVersion >= 3)
  18.    {
  19.      while (Packet.GetNextData() != NULL)
  20. @@ -2721,6 +2724,11 @@
  21.              (ExtensionData)));
  22.          }
  23.        }
  24. +      else if (ExtensionName == SFTP_EXT_UTF8)
  25. +      {
  26. +        FTerminal->LogEvent("Server is using UTF-8 filenames");
  27. +        Utf8Hint = true;
  28. +      }
  29.        else
  30.        {
  31.          FTerminal->LogEvent(FORMAT("Unknown server extension %s=%s",
  32. @@ -2765,7 +2773,7 @@
  33.    FUtfStrings =
  34.      (FTerminal->SessionData->Utf == asOff) ||
  35.      ((FTerminal->SessionData->Utf == asAuto) &&
  36. -      (FVersion >= 4) && !FUtfNever);
  37. +      ((FVersion >= 4) || Utf8Hint) && !FUtfNever);
  38.  
  39.    if (FUtfStrings)
  40.    {

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.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

fantasy-obligation
fantasy-obligation
fantasy-obligation