Johhnns
... newLine The FileReader and FileWriter classes always use the system's default character encoding. If this default is not appropriate (for example, when reading an XML file which specifies its own encoding), the recommended alternatives are, for example : FileInputStream fis = new FileInputStream("test.txt"); InputStreamReader in = new InputStreamReader(fis, "UTF-8"); FileOutputStream fos = new FileOutputStream("test.txt"); OutputStreamWriter out = new OutputStreamWriter(fos, "UTF-8"); Example : import java.io.*; public class ReadWriteTextFile { /** * Fetch the entire contents of a text file, and return it in a String. * This style of implementation does not throw Exceptions to the caller. * * @param aFile is a file which already exists and can be read. */ static public String getContents(File aFile) { //...checks on aFile are elided StringBuffer contents = new StringBuffer(); //declared here only to make visible to finally clause BufferedReader input = null; try { //use buffering, reading one line at a time //FileReader always assumes default encoding is OK! input = new BufferedReader( new FileReader(aFile) ); String line = null; //not declared within while loop /* * readLine is a bit quirky : * it returns the content of a line MINUS the newline....