[
https://issues.apache.org/jira/browse/NET-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17317536#comment-17317536
]
Daniel Fernández commented on NET-240:
--------------------------------------
For mere documentation purposes, please note that if the server is a Windows
IIS FTP server, UTF8 will not be used in connections even if it is allowed in
server configuration, unless explicitly specified. This is even if FTPClient's
{{controlEncoding}} is set to {{UTF-8}}.
So Chinese/Japanese characters will be returned as question marks ({{?}})
unless an {{"OPTS UTF8 ON"}} command is issued after connecting.
{code}
SYST
215 Windows_NT
FEAT
211-Extended features supported:
LANG EN*
UTF8
AUTH TLS;TLS-C;SSL;TLS-P;
PBSZ
PROT C;P;
CCC
HOST
SIZE
MDTM
REST STREAM
211 END
OPTS UTF8 ON
200 OPTS UTF8 command successful - UTF8 encoding now ON.
{code}
> FTPClient can't support Chinese or Japanese language in listFiles()
> -------------------------------------------------------------------
>
> Key: NET-240
> URL: https://issues.apache.org/jira/browse/NET-240
> Project: Commons Net
> Issue Type: Bug
> Affects Versions: 2.0
> Environment: Both Win and Linux, jdk1.5 or jdk1.6
> Reporter: Eisen Wang
> Priority: Major
>
> while coding as below:
> FTPClient ftp = new FTPClient();
> int reply;
> ftp.connect("10.110.13.18",2001);
> ftp.login("user","password");
> // ... // transfer files
> ftp.type(FTPClient.ASCII_FILE_TYPE);
> FTPFile[] temp = ftp.listFiles();
> System.out.println(temp.length);
> for (int i = 0; i < temp.length; i++)
> {
> System.out.println(temp[i].getName());
> }; //filtered all the files
> if the remote ftp server has a Chinese or Japanese file, then it would print
> a massive text on screen.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)