0

I have a template file (template.txt) saved in utf-8 format. Contents are as below:

placholder1¬placholder2

Notice that it has a latin character ¬ .

My Java application reads this file replaces the placeholder as per business logic and saves it to another file (cdr.txt) which is also in utf-8

Contents of cdr.txt are as below:

val1¬val2

This file is then transferred to remote system via FTP and in remote system when I see the content it looks like:

val1¬val2


I want this file content to be:

val1¬val2

Where am I going wrong?

My java application is running with option -Dfile.encoding=UTF-8

Xavier DSouza
  • 2,861
  • 7
  • 29
  • 40
  • 1
    Make sure you're handling all strings as UTF-8, both when reading and writing content to/from the files mentioned. If you do, then there should be no problem. Show us some code from when you read / write the files – Robin Jonsson Aug 11 '16 at 09:23
  • Also, make sure you're compiling with UTF-8 as encoding if you have the latin character somewhere in the java sourcecode. – Robin Jonsson Aug 11 '16 at 09:25
  • 1
    Character encoding problems can be in many places. Make sure that whatever program you are displaying the content of the file with, is interpreting it as UTF-8. Otherwise the file might be correct, but it's just being displayed incorrectly. – Jesper Aug 11 '16 at 09:46

0 Answers0