vivek garg
vivek garg

Reputation: 283

JSch to download file with file name in non ASCII characters

I am using JSch's ChannelSftp to download files from remote FTP server to local linux machine. When remote machine has file's with filenames which have non-ascii characters, downloaded file has ? instead of those non-ascii characters.

For example a file with filename - test-測試中國人的字.txt present in the ftp server will appear as test-??????.txt after downloading on local machine.

Is there a way, I can retain the non-ascii characters after downloading or automatically convert them to something more meaningful.

Upvotes: 0

Views: 1631

Answers (1)

vivek garg
vivek garg

Reputation: 283

Here, problem was that client was not supporting UTF-8 encoding. This issue was solved by setting language in jvm argument to UTF8 in the client application.

Upvotes: 1

Related Questions