How to write a "UTF 16" encoding File over FTP in java

I want to write a file directly in the FTP server using java and which needs to be in the UTF-16 format so that I can have support of latin,chinese,etc. characters .

Any suggestion will be of great help.

Thanks in advance.:))

Jon Skeet
people
quotationmark

Well, to start with it doesn't need to be UTF-16 to support all characters - I'd recommend UTF-8 instead of UTF-16.

However, basically you should transfer it as if it's a just a binary file (in binary mode in FTP). That way the bytes will be transferred with no textual interpretation so the two ends don't need to agree on an encoding at all.

people

See more on this question at Stackoverflow