public class FileCharsetDetector extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
FileCharsetDetector.Observer |
| 构造器和说明 |
|---|
FileCharsetDetector() |
| 限定符和类型 | 方法和说明 |
|---|---|
static FileCharsetDetector.Observer |
guessFileEncoding(File file)
传入一个文件(File)对象,检查文件编码
|
static FileCharsetDetector.Observer |
guessFileEncoding(File file,
int languageHint)
获取文件的编码
|
private static FileCharsetDetector.Observer |
guessFileEncoding(File file,
org.mozilla.intl.chardet.nsDetector det)
获取文件的编码
|
public static FileCharsetDetector.Observer guessFileEncoding(File file) throws FileNotFoundException, IOException
file - File对象实例FileNotFoundExceptionIOExceptionpublic static FileCharsetDetector.Observer guessFileEncoding(File file, int languageHint) throws FileNotFoundException, IOException
获取文件的编码
file - File对象实例languageHint - 语言提示区域代码 @see #nsPSMDetector ,取值如下:
1 : Japanese
2 : Chinese
3 : Simplified Chinese
4 : Traditional Chinese
5 : Korean
6 : Dont know(default)
FileNotFoundExceptionIOExceptionprivate static FileCharsetDetector.Observer guessFileEncoding(File file, org.mozilla.intl.chardet.nsDetector det) throws FileNotFoundException, IOException
file - det - FileNotFoundExceptionIOExceptionCopyright © 2019. All rights reserved.