Closed zhang13690 closed 4 years ago
In a project, I need to detect the encoding of a CSV file.
CSV is a line by line text file, but when I saved a CSV file like this(using UTF-8 or GBK):
demo, 汉字(chinese),
juniversalchardet cannot detect the encoding.
Code :
String encoding = UniversalDetector.detectCharset(new File(myCsvFile)); // the result of "encoding" is null
So is there a way to detect the encoding of a csv file?
In a project, I need to detect the encoding of a CSV file.
CSV is a line by line text file, but when I saved a CSV file like this(using UTF-8 or GBK):
juniversalchardet cannot detect the encoding.
Code :
So is there a way to detect the encoding of a csv file?