Commons Net
  1. Commons Net
  2. NET-314

The FTP client should autodetect the control encoding.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 3.0
    • Component/s: FTP
    • Labels:
      None
    • Environment:

      Java client using FTP through VFS to connect to a Java (Alfresco's) FTP server

      Description

      The Alfresco FTP server uses UTF8 for the control encoding. FTPClient can be set to use UTF8, but VFS does not expose that (https://issues.apache.org/jira/browse/VFS-305) and needs to be modified to fix this. But that is not the issue here; FileZilla is able to automatically detect that Alfresco's FTP server is using UTF8. So apparantly the server is somehow communicating this to the client. Being able to automatically set the encoding, would greately improve the out-of-the-box quality of the FTP component.

      1. ftp-autodetect-utf.diff
        3 kB
        Bogdan Drozdowski

        Activity

        Hide
        Bogdan Drozdowski added a comment -

        I believe the only non-ASCII encoding permitted is UTF-8 (http://tools.ietf.org/html/rfc2640), this is detected by sending the FEAT command and looking for "UTF8" in the response. The attached file does exactly this, right after the connection (original server greeting saved & restored later). The autodetection is user-controlled.

        Show
        Bogdan Drozdowski added a comment - I believe the only non-ASCII encoding permitted is UTF-8 ( http://tools.ietf.org/html/rfc2640 ), this is detected by sending the FEAT command and looking for "UTF8" in the response. The attached file does exactly this, right after the connection (original server greeting saved & restored later). The autodetection is user-controlled.
        Hide
        Sebb added a comment -

        Thanks very much!

        Patch applied with one trivial change - renamed the boolean as __autodetectEncoding to agree with the other private fields.

        Show
        Sebb added a comment - Thanks very much! Patch applied with one trivial change - renamed the boolean as __autodetectEncoding to agree with the other private fields.

          People

          • Assignee:
            Unassigned
            Reporter:
            Tom
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development