5

java commons-net ftp 下载时,如果文件名是中文,导致retrieveFileStream读出的结果...

 2 years ago
source link: https://www.oschina.net/question/147272_2324788
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

java commons-net ftp 下载时,如果文件名是中文,导致retrieveFileStream读出的结果为null

levis999 发布于 今天 10:04

java commons-net ftp 下载时,如果文件名是中文,导致retrieveFileStream读出的结果为null

ftpClient.setControlEncoding("gbk");

in = ftpClient.retrieveFileStream(new String(pa.getBytes("UTF-8"), "ISO-8859-1"));//这一行,对于中文文件名时返回空


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK