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

14 lines
374 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
Reading UTF-8 Encoded Data
public static void main(String args[]){
try{
BufferedReader in = new BufferedReader(
new InputStreamReader(new FileInputStream("file.txt"), "UTF8"));
String str = in.readLine();
System.out.println(str);
}
catch (Exception ioe){
ioe.printStackTrace();
}
}