The API docs for FileWriter say "The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream.". So if your default character is not UTF-8 you can't use FileWriter.
Unfortunately life is not as simple as just using something like the following unless you can guarantee your output text can be encoded as UTF-8:
The problem is this will silently hide encoding errors so if you need to detect these will have to create an encoder ie:
Joined: Oct 22, 2002
Just adding the append parameter to FileOutputStream and everything works.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com