I made this small Java program using eclipse IDE. I have set the workspace to support UTF-8 and the program runs happily when executed from eclipse.
Part of the program
You don't mention the classes you use to write to file, but have you tried setting the encoding explicitly?
For example:
Writer out = new OutputStreamWriter(fos, "UTF8");