程序包 org.meteoinfo.io

类 FileCharsetDetector


  • public class FileCharsetDetector
    extends java.lang.Object
    Using JCharDet get file charset
    作者:
    icer PS: JCharDet: http://jchardet.sourceforge.net/
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.String guestFileEncoding​(java.io.File file)
      Check file encoding
      java.lang.String guestFileEncoding​(java.io.File file, int languageHint)
      Check file encoding
      java.lang.String guestFileEncoding​(java.lang.String path)
      Check file encoding
      java.lang.String guestFileEncoding​(java.lang.String path, int languageHint)
      Get file encoding
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • FileCharsetDetector

        public FileCharsetDetector()
    • 方法详细资料

      • guestFileEncoding

        public java.lang.String guestFileEncoding​(java.io.File file)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
        Check file encoding
        参数:
        file - File object
        返回:
        Encoding string
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
      • guestFileEncoding

        public java.lang.String guestFileEncoding​(java.io.File file,
                                                  int languageHint)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
        Check file encoding
        参数:
        file - File object
        languageHint - Language comment code, eg: 1 : Japanese; 2 : Chinese; 3 : Simplified Chinese; 4 : Traditional Chinese; 5 : Korean; 6 : Dont know (default)
        返回:
        File encoding, eg: UTF-8,GBK,GB2312
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
      • guestFileEncoding

        public java.lang.String guestFileEncoding​(java.lang.String path)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
        Check file encoding
        参数:
        path - File path
        返回:
        File encoding
        抛出:
        java.io.FileNotFoundException
        java.io.IOException
      • guestFileEncoding

        public java.lang.String guestFileEncoding​(java.lang.String path,
                                                  int languageHint)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
        Get file encoding
        参数:
        path - File path
        languageHint - Language comment code, eg: 1 : Japanese; 2 : Chinese; 3 : Simplified Chinese; 4 : Traditional Chinese; 5 : Korean; 6 : Dont know (default)
        返回:
        抛出:
        java.io.FileNotFoundException
        java.io.IOException