As you know, the Java programming language itself is fully Unicode-based. However, operating systems typically have their own character encoding, such as ISO 8859-1 (an 8-bit code sometimes called the “ANSI” code) in the United States, or Big5 in Taiwan.
When you save data to a text file, you should respect the local character encoding so that the users of your program can open the text file in their other applications. Specify the character encoding in the
out = new FileWriter(filename, "ISO-8859-1");
Unfortunately, there is currently no connection between locales and character encodings. For example, if ...