Here you can find the source of writeFileUTF(String nom)
public static PrintWriter writeFileUTF(String nom) throws FileNotFoundException
//package com.java2s; /*//from ww w. ja v a 2 s .c o m This source code is copyrighted by Christophe Cerisara, CNRS, France. It is licensed under the terms of the INRIA Cecill-C licence, as described in: http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html */ import java.io.*; import java.nio.charset.Charset; public class Main { /** @deprecated use getUTF8Writer instead */ public static PrintWriter writeFileUTF(String nom) throws FileNotFoundException { return new PrintWriter(getUTF8Writer(new File(nom))); } public static Writer getUTF8Writer(File f) throws FileNotFoundException { // http://stackoverflow.com/a/9853261 return new BufferedWriter( new OutputStreamWriter(new FileOutputStream(f), Charset.forName("UTF-8").newEncoder())); } }