commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CARROLLE Mathieu <mathieu.carro...@petalslink.com>
Subject Re: Store file with arabic filename
Date Tue, 23 Feb 2010 22:08:52 GMT
Le 23/02/2010 15:36, NBW a écrit :
> Can your server handle UTF8 file names? Have you tried manually FTPing
> to it with a tool like FileZilla or Unix FTP to see if it can?
>
> -Noah
>
> On Tue, Feb 23, 2010 at 11:59 AM, CARROLLE Mathieu
> <mathieu.carrolle@petalslink.com>  wrote:
>    
>> Hi,
>> I am sending file with arabic filename on ftp server and it doesn't
>> work. Arabic character are replace by ?. I am using the storeFile method.
>> Here my code snippet :
>>
>>         String filename = null;
>>
>>         filename = "س.xml";//Unicode value: \u0633
>>
>>         File file = new File(filename);
>>
>>         InputStream in = null;
>>
>>         try {
>>
>>             in = new FileInputStream(file);
>>
>>             if (in != null) {
>>
>>                 FTPClient client = new FTPClient();
>>
>>                 client.connect("####");
>>
>>                 client.login("####", "#####");
>>
>>                 client.setControlEncoding("UTF-8");
>>
>>                 client.storeFile(filename, in);
>>
>>                 in.close();
>>
>>             }
>>
>>         } catch (Exception e) {
>>
>>             e.printStackTrace();
>>
>>         }
>>
>>
>> Can anybody help me ?
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
>    
Yes,

I already try with standard ftp client and different server, it works well.
Standard client transform the character in octal code(thanks to 
wireshark tool).

Mathieu.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message