程序包 org.meteoinfo.io
类 EncodingDetect
- java.lang.Object
-
- org.meteoinfo.io.EncodingDetect
-
public class EncodingDetect extends 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
-
-
字段概要
字段 修饰符和类型 字段 说明 static intASCIIstatic intBIG5static intCNS11643static intCP949booleandebugstatic intEUC_JPstatic intEUC_KRstatic intGB18030static intGB2312static intGBKstatic String[]htmlnamestatic intHZstatic intISO2022CNstatic intISO2022CN_CNSstatic intISO2022CN_GBstatic intISO2022JPstatic intISO2022KRstatic String[]javanamestatic intJOHABstatic String[]nicenamestatic intOTHERstatic intSIMPstatic intSJISstatic intTOTALTYPESstatic intTRADstatic intUNICODEstatic intUNICODESstatic intUNICODETstatic intUTF8static intUTF8Sstatic intUTF8T
-
构造器概要
构造器 构造器 说明 EncodingDetect()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 intdetectEncoding(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.intdetectEncoding(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.intdetectEncoding(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 voidmain(String[] argc)
-
-
-
字段详细资料
-
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
-
SIMP
public static final int SIMP
- 另请参阅:
- 常量字段值
-
TRAD
public static final int TRAD
- 另请参阅:
- 常量字段值
-
javaname
public static String[] javaname
-
nicename
public static String[] nicename
-
htmlname
public static String[] htmlname
-
-
方法详细资料
-
main
public static void main(String[] argc)
-
detectEncoding
public int detectEncoding(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(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.
-
-