I have a problem writing a file generated by a java ( 1.4.2) applicationin unix.
Basically the app will generate a txt file,using the class FileUtils, to a unix folder. The objective is to download the file and view it in windows.
The encoding i´m using when writing occurs in unix is UTF-8.
When i download the file some characters like ´ ~ ^ are encoded and aren´t correctly displayed.
What can i do to correct this behaviour?
How exactly are you downloading the file and how are you displaying it? Are you displaying it in a browser window, text editor, or in the Windows command prompt? Are you reading the file in your Java program? Have you specified that the file has to be interpreted as UTF-8?
You need to make sure that whatever you use to display the file understands the UTF-8 encoding and can show you the characters correctly.
To read an UTF-8 text file in Java, you can open it using an InputStreamReader and specify the character encoding, like this: