• Post Reply Bookmark Topic Watch Topic
  • New Topic

Special characters while writing file in linux env

 
Mani Venkata Kanth
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an application running in Linux environment. This modules reads the below string and writes in a new file.

XYZZZABDS.ÿ$ABDCJDDMDLGDMG

However, while writing using the below line, I am getting the out put as below.

XYZZZABDS.ÿ$ABDCJDDMDLGDMG

Due to this my application throws an exception.

Please suggest me if there is any turn around or suggestions to resolve this issue.

 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of using FileWriter and FileReader, use FileOutputStream + OutputStreamWriter / FileInpuStream + InputStreamReader, supplying the same explicit encoding in both processes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!