programming-examples/java/Core_Java/Writing UTF-8 Encoded Data.java

14 lines
352 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
Writing UTF-8 Encoded Data
public static void main(String args[]){
try{
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream("outfilename"), "UTF8"));
out.write(aString);
out.close();
}
catch (Exception ioe){
ioe.printStackTrace();
}
}