Filename encoding in Apache Commons Net FTPClient

前端 未结 2 930
孤街浪徒
孤街浪徒 2021-02-13 14:31

I have to upload a file to an FTP server. The filename contains special letters, say äöü. On the FTP server, I need the filename to be UTF-8 encoded.

My cod

2条回答
  •  迷失自我
    2021-02-13 15:13

    Since Apache Commons NET 3.0 one can use ftpClient.setAutodetectUTF8( true ); to enable autodetection of UTF-8 support on the FTP server. Like setControlEncoding it must be called before connection.

    See the corresponding javadoc.

提交回复
热议问题