且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有可能“嗅"到字符编码?

更新时间:2023-11-10 16:16:16

没有仅通过查看文件本身来确定文件编码的正确方法,但是您可以使用一些基于启发式的解决方案,例如: chardet

There is no correct way to determine the encoding of a file by looking at only the file itself, but you can use some heuristics-based solution, eg.: chardet