2013-01-05 55 views
1

我有Unicode的問題,當我保存在SD卡上的阿拉伯文名稱的文件,所有的東西都會很好,但是當文件通過commons-net上傳到FTP服務器時,我會得到文件名如PICUTF-8與apache commons-net

Bad unicode

任何解決辦法嗎?

這是代號的一部分與FTPClient相關:

FTPClient ftpClient = new FTPClient(); 

       try { 

        FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_NT); 
         conf.setServerLanguageCode("ar"); 
         ftpClient.configure(conf); 
        ftpClient.setControlEncoding("UTF-8"); 
        ftpClient.setAutodetectUTF8(true); 
        ftpClient.connect(server, port); 
        ftpClient.login(user, pass); 
        ftpClient.enterLocalPassiveMode(); 
        ftpClient.setFileType(FTP.BINARY_FILE_TYPE); 

回答

0

使用非拉丁字符的文件名會造成很多問題。許多程序不會加載或顯示這些文件。如果真的需要這個文件命名,我會質疑自己。