2015/11/12

Java get file's character encoding


  InputStreamReader inputStreamReader = new InputStreamReader(
    new FileInputStream("C:/Users/CYFang/Downloads/愛因斯坦肥和莊富貴.txt"));
  System.out.println(inputStreamReader.getEncoding());