程序包 org.meteoinfo.io

类 EncodingDetect


  • public class EncodingDetect
    extends java.lang.Object
    (Detect encoding .) Copyright (C) (2009) (Fluck,ACC http://androidos.cc/dev ) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    从以下版本开始:
    Create on 2010-01-27 11:19:00
    版本:
    1.0
    作者:
    Billows.Van
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      int detectEncoding​(byte[] rawtext)
      Function : detectEncoding Aruguments: byte array Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the byte array and assigns it a probability score for each encoding type.
      int detectEncoding​(java.io.File testfile)
      Function : detectEncoding Aruguments: File Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the file and assigns it a probability score for each encoding type.
      int detectEncoding​(java.net.URL testurl)
      Function : detectEncoding Aruguments: URL Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the URL contents and assigns it a probability score for each encoding type.
      static void main​(java.lang.String[] argc)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • debug

        public boolean debug
      • GB2312

        public static int GB2312
      • GBK

        public static int GBK
      • GB18030

        public static int GB18030
      • HZ

        public static int HZ
      • BIG5

        public static int BIG5
      • CNS11643

        public static int CNS11643
      • UTF8

        public static int UTF8
      • UTF8T

        public static int UTF8T
      • UTF8S

        public static int UTF8S
      • UNICODE

        public static int UNICODE
      • UNICODET

        public static int UNICODET
      • UNICODES

        public static int UNICODES
      • ISO2022CN

        public static int ISO2022CN
      • ISO2022CN_CNS

        public static int ISO2022CN_CNS
      • ISO2022CN_GB

        public static int ISO2022CN_GB
      • EUC_KR

        public static int EUC_KR
      • CP949

        public static int CP949
      • ISO2022KR

        public static int ISO2022KR
      • JOHAB

        public static int JOHAB
      • SJIS

        public static int SJIS
      • EUC_JP

        public static int EUC_JP
      • ISO2022JP

        public static int ISO2022JP
      • ASCII

        public static int ASCII
      • OTHER

        public static int OTHER
      • TOTALTYPES

        public static int TOTALTYPES
      • javaname

        public static java.lang.String[] javaname
      • nicename

        public static java.lang.String[] nicename
      • htmlname

        public static java.lang.String[] htmlname
    • 构造器详细资料

      • EncodingDetect

        public EncodingDetect()
    • 方法详细资料

      • main

        public static void main​(java.lang.String[] argc)
      • detectEncoding

        public int detectEncoding​(java.net.URL testurl)
        Function : detectEncoding Aruguments: URL Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the URL contents and assigns it a probability score for each encoding type. The encoding type with the highest probability is returned.
      • detectEncoding

        public int detectEncoding​(java.io.File testfile)
        Function : detectEncoding Aruguments: File Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the file and assigns it a probability score for each encoding type. The encoding type with the highest probability is returned.
      • detectEncoding

        public int detectEncoding​(byte[] rawtext)
        Function : detectEncoding Aruguments: byte array Returns : One of the encodings from the Encoding enumeration (GB2312, HZ, BIG5, EUC_TW, ASCII, or OTHER) Description: This function looks at the byte array and assigns it a probability score for each encoding type. The encoding type with the highest probability is returned.