2010/6/28 Alex Xin <[email protected]>:
> For problem 2, Are there any classes or methods which I could use to set the
> charset?

Your first problem is that the FTP protocol does not declare the
charset used by the client. The RFC talks about ASCII and EBCDIC, and
then there is an extension that allows for using UTF-8. Since ASCII is
a subset of UTF-8, FtpServer assumes we can always use UTF-8. If a
client is using some other charset, your only option is to guess what
it might be.

Now, we set what charset we use in
org.apache.ftpserver.listener.nio.FtpServerProtocolCodecFactory and we
catch decoding errors in
org.apache.ftpserver.impl.DefaultFtpHandler.exceptionCaught(). We've
previously discussed having some form of fallback to a configurable
charset. However, we have never gotten around to implementing it.

/niklas

Reply via email to