📜  在 java 代码示例中将文件编码为 utf-8

📅  最后修改于: 2022-03-11 14:52:44.932000             🧑  作者: Mango

代码示例1
String charset = "ISO-8859-1"; // or what corresponds
  BufferedReader in = new BufferedReader( 
      new InputStreamReader (new FileInputStream(file), charset));
  String line;
  while( (line = in.readLine()) != null) { 
    ....
  }