网上好多不完全,总有个别txt的编码获取不到。
用这段代码,暂时没有发现问题。它在我的机器上可以很好运行! ——-大部分程序员
部分TXT识别不了的版本
1 | InputStream inputStream = new FileInputStream("g62.txt"); |
1 | BufferedInputStream bin = new BufferedInputStream(new FileInputStream("62.txt")); |
未发现问题版本
1 | private static String getFileCharset(File sourceFile) { |