So I\'m trying to make my program output a text file with a list of names. Some of the names have weird characters, such as Åström.
I have grabbed these list of names fr
The content is indeed in UTF-8 and it appears OK if printed to the console. What may be causing the problem is the decoding and encoding of the string which is unnecessary. Instead of an OutputStreamWriter try using a java.io.PrintWriter. It has the println methods that print out the string with the system line separator at the end. It would look something like:
printStream.println(list.get(i));
Also, when opening the file to see it try using a browser. They allow you to choose the encoding after opening it so you can try several encodings quickly to see what is being really used.