Java tutorial
//package com.java2s; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; public class Main { static void writeUtf(String text, String file) { Writer out; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); out.write(text); out.close(); } catch (IOException e) { e.printStackTrace(); } } }