code: public static Writer newBufferedUTF8FileWriter(final String file) throws UnsupportedEncodingException, FileNotFoundException {
          return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
      }
docs: Use this instead of {@link FileWriter} because you cannot specify the character encoding with that.