Solution to the problem that ftpclient uploads Chinese directory and Chinese file name in Java

Problem Description:

Use org apache. commons. net. ftp. When ftpclient creates a Chinese directory and uploads a Chinese file name, the Chinese in the directory name and file name is displayed as "?".

reason:

In the FTP protocol, the file name code is iso-8859-1, so the directory name or file name needs to be transcoded.

Solution:

1. Convert the Chinese directory or file name into iso-8859-1 encoded characters. Reference code:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>