[jchardet] 01/02: Imported Upstream version 1.1
Eugenio Cano-Manuel
zero123-guest at alioth.debian.org
Mon Sep 2 15:30:10 UTC 2013
This is an automated email from the git hooks/post-receive script.
zero123-guest pushed a commit to branch master
in repository jchardet.
commit 4f6fcb936a4d74973809d7eb24e6bf14091bb1df
Author: Eugenio Cano-Manuel <eugeniocanom at gmail.com>
Date: Thu Aug 29 13:20:46 2013 +0200
Imported Upstream version 1.1
---
LICENSE | 470 ++++++++++++++++++++++++++++++++++
build.xml | 39 +++
src/Big5Statistics.java | 264 +++++++++++++++++++
src/EUCJPStatistics.java | 266 +++++++++++++++++++
src/EUCKRStatistics.java | 266 +++++++++++++++++++
src/EUCTWStatistics.java | 264 +++++++++++++++++++
src/GB2312Statistics.java | 266 +++++++++++++++++++
src/HtmlCharsetDetector.java | 118 +++++++++
src/nsBIG5Verifier.java | 111 ++++++++
src/nsCP1252Verifier.java | 111 ++++++++
src/nsDetector.java | 86 +++++++
src/nsEUCJPVerifier.java | 113 ++++++++
src/nsEUCKRVerifier.java | 110 ++++++++
src/nsEUCSampler.java | 139 ++++++++++
src/nsEUCStatistics.java | 52 ++++
src/nsEUCTWVerifier.java | 114 +++++++++
src/nsGB18030Verifier.java | 114 +++++++++
src/nsGB2312Verifier.java | 110 ++++++++
src/nsHZVerifier.java | 114 +++++++++
src/nsICharsetDetectionObserver.java | 42 +++
src/nsICharsetDetector.java | 44 ++++
src/nsISO2022CNVerifier.java | 116 +++++++++
src/nsISO2022JPVerifier.java | 114 +++++++++
src/nsISO2022KRVerifier.java | 113 ++++++++
src/nsPSMDetector.java | 421 ++++++++++++++++++++++++++++++
src/nsSJISVerifier.java | 111 ++++++++
src/nsUCS2BEVerifier.java | 115 +++++++++
src/nsUCS2LEVerifier.java | 115 +++++++++
src/nsUTF8Verifier.java | 134 ++++++++++
src/nsVerifier.java | 75 ++++++
30 files changed, 4527 insertions(+)
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,470 @@
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+ Portions created by ______________________ are Copyright (C) ______
+ _______________________. All Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms
+ of the _____ license (the "[___] License"), in which case the
+ provisions of [______] License are applicable instead of those
+ above. If you wish to allow use of your version of this file only
+ under the terms of the [____] License and not to allow others to use
+ your version of this file under the MPL, indicate your decision by
+ deleting the provisions above and replace them with the notice and
+ other provisions required by the [___] License. If you do not delete
+ the provisions above, a recipient may use your version of this file
+ under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
+
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..74351ff
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,39 @@
+<project name="chardet" default="dist" basedir=".">
+ <description>
+ Java port of Automatic charset deduction module from Mozilla.
+ </description>
+ <!-- set global properties for this build -->
+ <property name="src" location="src"/>
+ <property name="build" location="build"/>
+ <property name="dist" location="dist"/>
+
+ <target name="init">
+ <!-- Create the time stamp -->
+ <tstamp/>
+ <!-- Create the build directory structure used by compile -->
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init"
+ description="compile the source " >
+ <!-- Compile the java code from ${src} into ${build} -->
+ <javac srcdir="${src}" destdir="${build}"/>
+ </target>
+
+ <target name="dist" depends="compile"
+ description="generate the distribution" >
+ <!-- Create the distribution directory -->
+ <mkdir dir="${dist}/lib"/>
+
+ <!-- Put everything in ${build} into the chardet.jar file -->
+ <jar jarfile="${dist}/lib/chardet.jar" basedir="${build}"/>
+ </target>
+
+ <target name="clean"
+ description="clean up" >
+ <!-- Delete the ${build} and ${dist} directory trees -->
+ <delete dir="${build}"/>
+ <delete dir="${dist}"/>
+ </target>
+</project>
+
diff --git a/src/Big5Statistics.java b/src/Big5Statistics.java
new file mode 100644
index 0000000..7dfb993
--- /dev/null
+++ b/src/Big5Statistics.java
@@ -0,0 +1,264 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class Big5Statistics extends nsEUCStatistics {
+
+ static float[] mFirstByteFreq ;
+ static float mFirstByteStdDev;
+ static float mFirstByteMean;
+ static float mFirstByteWeight;
+ static float[] mSecondByteFreq;
+ static float mSecondByteStdDev;
+ static float mSecondByteMean;
+ static float mSecondByteWeight;
+
+ public float[] mFirstByteFreq() { return mFirstByteFreq; }
+ public float mFirstByteStdDev() { return mFirstByteStdDev; }
+ public float mFirstByteMean() { return mFirstByteMean; }
+ public float mFirstByteWeight() { return mFirstByteWeight; }
+ public float[] mSecondByteFreq() { return mSecondByteFreq; }
+ public float mSecondByteStdDev() { return mSecondByteStdDev; }
+ public float mSecondByteMean() { return mSecondByteMean; }
+ public float mSecondByteWeight() { return mSecondByteWeight; }
+
+ public Big5Statistics() {
+
+ mFirstByteFreq = new float[] {
+ 0.000000f, // FreqH[a1]
+ 0.000000f, // FreqH[a2]
+ 0.000000f, // FreqH[a3]
+ 0.114427f, // FreqH[a4]
+ 0.061058f, // FreqH[a5]
+ 0.075598f, // FreqH[a6]
+ 0.048386f, // FreqH[a7]
+ 0.063966f, // FreqH[a8]
+ 0.027094f, // FreqH[a9]
+ 0.095787f, // FreqH[aa]
+ 0.029525f, // FreqH[ab]
+ 0.031331f, // FreqH[ac]
+ 0.036915f, // FreqH[ad]
+ 0.021805f, // FreqH[ae]
+ 0.019349f, // FreqH[af]
+ 0.037496f, // FreqH[b0]
+ 0.018068f, // FreqH[b1]
+ 0.012760f, // FreqH[b2]
+ 0.030053f, // FreqH[b3]
+ 0.017339f, // FreqH[b4]
+ 0.016731f, // FreqH[b5]
+ 0.019501f, // FreqH[b6]
+ 0.011240f, // FreqH[b7]
+ 0.032973f, // FreqH[b8]
+ 0.016658f, // FreqH[b9]
+ 0.015872f, // FreqH[ba]
+ 0.021458f, // FreqH[bb]
+ 0.012378f, // FreqH[bc]
+ 0.017003f, // FreqH[bd]
+ 0.020802f, // FreqH[be]
+ 0.012454f, // FreqH[bf]
+ 0.009239f, // FreqH[c0]
+ 0.012829f, // FreqH[c1]
+ 0.007922f, // FreqH[c2]
+ 0.010079f, // FreqH[c3]
+ 0.009815f, // FreqH[c4]
+ 0.010104f, // FreqH[c5]
+ 0.000000f, // FreqH[c6]
+ 0.000000f, // FreqH[c7]
+ 0.000000f, // FreqH[c8]
+ 0.000053f, // FreqH[c9]
+ 0.000035f, // FreqH[ca]
+ 0.000105f, // FreqH[cb]
+ 0.000031f, // FreqH[cc]
+ 0.000088f, // FreqH[cd]
+ 0.000027f, // FreqH[ce]
+ 0.000027f, // FreqH[cf]
+ 0.000026f, // FreqH[d0]
+ 0.000035f, // FreqH[d1]
+ 0.000024f, // FreqH[d2]
+ 0.000034f, // FreqH[d3]
+ 0.000375f, // FreqH[d4]
+ 0.000025f, // FreqH[d5]
+ 0.000028f, // FreqH[d6]
+ 0.000020f, // FreqH[d7]
+ 0.000024f, // FreqH[d8]
+ 0.000028f, // FreqH[d9]
+ 0.000031f, // FreqH[da]
+ 0.000059f, // FreqH[db]
+ 0.000040f, // FreqH[dc]
+ 0.000030f, // FreqH[dd]
+ 0.000079f, // FreqH[de]
+ 0.000037f, // FreqH[df]
+ 0.000040f, // FreqH[e0]
+ 0.000023f, // FreqH[e1]
+ 0.000030f, // FreqH[e2]
+ 0.000027f, // FreqH[e3]
+ 0.000064f, // FreqH[e4]
+ 0.000020f, // FreqH[e5]
+ 0.000027f, // FreqH[e6]
+ 0.000025f, // FreqH[e7]
+ 0.000074f, // FreqH[e8]
+ 0.000019f, // FreqH[e9]
+ 0.000023f, // FreqH[ea]
+ 0.000021f, // FreqH[eb]
+ 0.000018f, // FreqH[ec]
+ 0.000017f, // FreqH[ed]
+ 0.000035f, // FreqH[ee]
+ 0.000021f, // FreqH[ef]
+ 0.000019f, // FreqH[f0]
+ 0.000025f, // FreqH[f1]
+ 0.000017f, // FreqH[f2]
+ 0.000037f, // FreqH[f3]
+ 0.000018f, // FreqH[f4]
+ 0.000018f, // FreqH[f5]
+ 0.000019f, // FreqH[f6]
+ 0.000022f, // FreqH[f7]
+ 0.000033f, // FreqH[f8]
+ 0.000032f, // FreqH[f9]
+ 0.000000f, // FreqH[fa]
+ 0.000000f, // FreqH[fb]
+ 0.000000f, // FreqH[fc]
+ 0.000000f, // FreqH[fd]
+ 0.000000f // FreqH[fe]
+ };
+
+ mFirstByteStdDev = 0.020606f; // Lead Byte StdDev
+ mFirstByteMean = 0.010638f; // Lead Byte Mean
+ mFirstByteWeight = 0.675261f; // Lead Byte Weight
+
+ mSecondByteFreq = new float[] {
+ 0.020256f, // FreqL[a1]
+ 0.003293f, // FreqL[a2]
+ 0.045811f, // FreqL[a3]
+ 0.016650f, // FreqL[a4]
+ 0.007066f, // FreqL[a5]
+ 0.004146f, // FreqL[a6]
+ 0.009229f, // FreqL[a7]
+ 0.007333f, // FreqL[a8]
+ 0.003296f, // FreqL[a9]
+ 0.005239f, // FreqL[aa]
+ 0.008282f, // FreqL[ab]
+ 0.003791f, // FreqL[ac]
+ 0.006116f, // FreqL[ad]
+ 0.003536f, // FreqL[ae]
+ 0.004024f, // FreqL[af]
+ 0.016654f, // FreqL[b0]
+ 0.009334f, // FreqL[b1]
+ 0.005429f, // FreqL[b2]
+ 0.033392f, // FreqL[b3]
+ 0.006121f, // FreqL[b4]
+ 0.008983f, // FreqL[b5]
+ 0.002801f, // FreqL[b6]
+ 0.004221f, // FreqL[b7]
+ 0.010357f, // FreqL[b8]
+ 0.014695f, // FreqL[b9]
+ 0.077937f, // FreqL[ba]
+ 0.006314f, // FreqL[bb]
+ 0.004020f, // FreqL[bc]
+ 0.007331f, // FreqL[bd]
+ 0.007150f, // FreqL[be]
+ 0.005341f, // FreqL[bf]
+ 0.009195f, // FreqL[c0]
+ 0.005350f, // FreqL[c1]
+ 0.005698f, // FreqL[c2]
+ 0.004472f, // FreqL[c3]
+ 0.007242f, // FreqL[c4]
+ 0.004039f, // FreqL[c5]
+ 0.011154f, // FreqL[c6]
+ 0.016184f, // FreqL[c7]
+ 0.004741f, // FreqL[c8]
+ 0.012814f, // FreqL[c9]
+ 0.007679f, // FreqL[ca]
+ 0.008045f, // FreqL[cb]
+ 0.016631f, // FreqL[cc]
+ 0.009451f, // FreqL[cd]
+ 0.016487f, // FreqL[ce]
+ 0.007287f, // FreqL[cf]
+ 0.012688f, // FreqL[d0]
+ 0.017421f, // FreqL[d1]
+ 0.013205f, // FreqL[d2]
+ 0.031480f, // FreqL[d3]
+ 0.003404f, // FreqL[d4]
+ 0.009149f, // FreqL[d5]
+ 0.008921f, // FreqL[d6]
+ 0.007514f, // FreqL[d7]
+ 0.008683f, // FreqL[d8]
+ 0.008203f, // FreqL[d9]
+ 0.031403f, // FreqL[da]
+ 0.011733f, // FreqL[db]
+ 0.015617f, // FreqL[dc]
+ 0.015306f, // FreqL[dd]
+ 0.004004f, // FreqL[de]
+ 0.010899f, // FreqL[df]
+ 0.009961f, // FreqL[e0]
+ 0.008388f, // FreqL[e1]
+ 0.010920f, // FreqL[e2]
+ 0.003925f, // FreqL[e3]
+ 0.008585f, // FreqL[e4]
+ 0.009108f, // FreqL[e5]
+ 0.015546f, // FreqL[e6]
+ 0.004659f, // FreqL[e7]
+ 0.006934f, // FreqL[e8]
+ 0.007023f, // FreqL[e9]
+ 0.020252f, // FreqL[ea]
+ 0.005387f, // FreqL[eb]
+ 0.024704f, // FreqL[ec]
+ 0.006963f, // FreqL[ed]
+ 0.002625f, // FreqL[ee]
+ 0.009512f, // FreqL[ef]
+ 0.002971f, // FreqL[f0]
+ 0.008233f, // FreqL[f1]
+ 0.010000f, // FreqL[f2]
+ 0.011973f, // FreqL[f3]
+ 0.010553f, // FreqL[f4]
+ 0.005945f, // FreqL[f5]
+ 0.006349f, // FreqL[f6]
+ 0.009401f, // FreqL[f7]
+ 0.008577f, // FreqL[f8]
+ 0.008186f, // FreqL[f9]
+ 0.008159f, // FreqL[fa]
+ 0.005033f, // FreqL[fb]
+ 0.008714f, // FreqL[fc]
+ 0.010614f, // FreqL[fd]
+ 0.006554f // FreqL[fe]
+ };
+
+ mSecondByteStdDev = 0.009909f; // Trail Byte StdDev
+ mSecondByteMean = 0.010638f; // Trail Byte Mean
+ mSecondByteWeight = 0.324739f ; // Trial Byte Weight
+
+ }
+}
+
diff --git a/src/EUCJPStatistics.java b/src/EUCJPStatistics.java
new file mode 100644
index 0000000..809a1b2
--- /dev/null
+++ b/src/EUCJPStatistics.java
@@ -0,0 +1,266 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class EUCJPStatistics extends nsEUCStatistics {
+
+
+ static float[] mFirstByteFreq ;
+ static float mFirstByteStdDev;
+ static float mFirstByteMean;
+ static float mFirstByteWeight;
+ static float[] mSecondByteFreq;
+ static float mSecondByteStdDev;
+ static float mSecondByteMean;
+ static float mSecondByteWeight;
+
+ public float[] mFirstByteFreq() { return mFirstByteFreq; }
+ public float mFirstByteStdDev() { return mFirstByteStdDev; }
+ public float mFirstByteMean() { return mFirstByteMean; }
+ public float mFirstByteWeight() { return mFirstByteWeight; }
+ public float[] mSecondByteFreq() { return mSecondByteFreq; }
+ public float mSecondByteStdDev() { return mSecondByteStdDev; }
+ public float mSecondByteMean() { return mSecondByteMean; }
+ public float mSecondByteWeight() { return mSecondByteWeight; }
+
+ public EUCJPStatistics() {
+
+ mFirstByteFreq = new float[] {
+ 0.364808f, // FreqH[a1]
+ 0.000000f, // FreqH[a2]
+ 0.000000f, // FreqH[a3]
+ 0.145325f, // FreqH[a4]
+ 0.304891f, // FreqH[a5]
+ 0.000000f, // FreqH[a6]
+ 0.000000f, // FreqH[a7]
+ 0.000000f, // FreqH[a8]
+ 0.000000f, // FreqH[a9]
+ 0.000000f, // FreqH[aa]
+ 0.000000f, // FreqH[ab]
+ 0.000000f, // FreqH[ac]
+ 0.000000f, // FreqH[ad]
+ 0.000000f, // FreqH[ae]
+ 0.000000f, // FreqH[af]
+ 0.001835f, // FreqH[b0]
+ 0.010771f, // FreqH[b1]
+ 0.006462f, // FreqH[b2]
+ 0.001157f, // FreqH[b3]
+ 0.002114f, // FreqH[b4]
+ 0.003231f, // FreqH[b5]
+ 0.001356f, // FreqH[b6]
+ 0.007420f, // FreqH[b7]
+ 0.004189f, // FreqH[b8]
+ 0.003231f, // FreqH[b9]
+ 0.003032f, // FreqH[ba]
+ 0.033190f, // FreqH[bb]
+ 0.006303f, // FreqH[bc]
+ 0.006064f, // FreqH[bd]
+ 0.009973f, // FreqH[be]
+ 0.002354f, // FreqH[bf]
+ 0.003670f, // FreqH[c0]
+ 0.009135f, // FreqH[c1]
+ 0.001675f, // FreqH[c2]
+ 0.002792f, // FreqH[c3]
+ 0.002194f, // FreqH[c4]
+ 0.014720f, // FreqH[c5]
+ 0.011928f, // FreqH[c6]
+ 0.000878f, // FreqH[c7]
+ 0.013124f, // FreqH[c8]
+ 0.001077f, // FreqH[c9]
+ 0.009295f, // FreqH[ca]
+ 0.003471f, // FreqH[cb]
+ 0.002872f, // FreqH[cc]
+ 0.002433f, // FreqH[cd]
+ 0.000957f, // FreqH[ce]
+ 0.001636f, // FreqH[cf]
+ 0.000000f, // FreqH[d0]
+ 0.000000f, // FreqH[d1]
+ 0.000000f, // FreqH[d2]
+ 0.000000f, // FreqH[d3]
+ 0.000000f, // FreqH[d4]
+ 0.000000f, // FreqH[d5]
+ 0.000000f, // FreqH[d6]
+ 0.000000f, // FreqH[d7]
+ 0.000000f, // FreqH[d8]
+ 0.000000f, // FreqH[d9]
+ 0.000000f, // FreqH[da]
+ 0.000000f, // FreqH[db]
+ 0.000000f, // FreqH[dc]
+ 0.000000f, // FreqH[dd]
+ 0.000080f, // FreqH[de]
+ 0.000279f, // FreqH[df]
+ 0.000000f, // FreqH[e0]
+ 0.000000f, // FreqH[e1]
+ 0.000000f, // FreqH[e2]
+ 0.000000f, // FreqH[e3]
+ 0.000000f, // FreqH[e4]
+ 0.000000f, // FreqH[e5]
+ 0.000000f, // FreqH[e6]
+ 0.000000f, // FreqH[e7]
+ 0.000000f, // FreqH[e8]
+ 0.000000f, // FreqH[e9]
+ 0.000000f, // FreqH[ea]
+ 0.000000f, // FreqH[eb]
+ 0.000000f, // FreqH[ec]
+ 0.000000f, // FreqH[ed]
+ 0.000000f, // FreqH[ee]
+ 0.000000f, // FreqH[ef]
+ 0.000000f, // FreqH[f0]
+ 0.000000f, // FreqH[f1]
+ 0.000000f, // FreqH[f2]
+ 0.000000f, // FreqH[f3]
+ 0.000000f, // FreqH[f4]
+ 0.000000f, // FreqH[f5]
+ 0.000000f, // FreqH[f6]
+ 0.000000f, // FreqH[f7]
+ 0.000000f, // FreqH[f8]
+ 0.000000f, // FreqH[f9]
+ 0.000000f, // FreqH[fa]
+ 0.000000f, // FreqH[fb]
+ 0.000000f, // FreqH[fc]
+ 0.000080f, // FreqH[fd]
+ 0.000000f // FreqH[fe]
+
+ };
+
+ mFirstByteStdDev = 0.050407f; // Lead Byte StdDev
+ mFirstByteMean = 0.010638f; // Lead Byte Mean
+ mFirstByteWeight = 0.640871f; // Lead Byte Weight
+
+ mSecondByteFreq = new float[] {
+ 0.002473f, // FreqL[a1]
+ 0.039134f, // FreqL[a2]
+ 0.152745f, // FreqL[a3]
+ 0.009694f, // FreqL[a4]
+ 0.000359f, // FreqL[a5]
+ 0.022180f, // FreqL[a6]
+ 0.000758f, // FreqL[a7]
+ 0.004308f, // FreqL[a8]
+ 0.000160f, // FreqL[a9]
+ 0.002513f, // FreqL[aa]
+ 0.003072f, // FreqL[ab]
+ 0.001316f, // FreqL[ac]
+ 0.003830f, // FreqL[ad]
+ 0.001037f, // FreqL[ae]
+ 0.003590f, // FreqL[af]
+ 0.000957f, // FreqL[b0]
+ 0.000160f, // FreqL[b1]
+ 0.000239f, // FreqL[b2]
+ 0.006462f, // FreqL[b3]
+ 0.001596f, // FreqL[b4]
+ 0.031554f, // FreqL[b5]
+ 0.001316f, // FreqL[b6]
+ 0.002194f, // FreqL[b7]
+ 0.016555f, // FreqL[b8]
+ 0.003271f, // FreqL[b9]
+ 0.000678f, // FreqL[ba]
+ 0.000598f, // FreqL[bb]
+ 0.206438f, // FreqL[bc]
+ 0.000718f, // FreqL[bd]
+ 0.001077f, // FreqL[be]
+ 0.003710f, // FreqL[bf]
+ 0.001356f, // FreqL[c0]
+ 0.001356f, // FreqL[c1]
+ 0.000439f, // FreqL[c2]
+ 0.004388f, // FreqL[c3]
+ 0.005704f, // FreqL[c4]
+ 0.000878f, // FreqL[c5]
+ 0.010172f, // FreqL[c6]
+ 0.007061f, // FreqL[c7]
+ 0.014680f, // FreqL[c8]
+ 0.000638f, // FreqL[c9]
+ 0.025730f, // FreqL[ca]
+ 0.002792f, // FreqL[cb]
+ 0.000718f, // FreqL[cc]
+ 0.001795f, // FreqL[cd]
+ 0.091551f, // FreqL[ce]
+ 0.000758f, // FreqL[cf]
+ 0.003909f, // FreqL[d0]
+ 0.000558f, // FreqL[d1]
+ 0.031195f, // FreqL[d2]
+ 0.007061f, // FreqL[d3]
+ 0.001316f, // FreqL[d4]
+ 0.022579f, // FreqL[d5]
+ 0.006981f, // FreqL[d6]
+ 0.007260f, // FreqL[d7]
+ 0.001117f, // FreqL[d8]
+ 0.000239f, // FreqL[d9]
+ 0.012127f, // FreqL[da]
+ 0.000878f, // FreqL[db]
+ 0.003790f, // FreqL[dc]
+ 0.001077f, // FreqL[dd]
+ 0.000758f, // FreqL[de]
+ 0.002114f, // FreqL[df]
+ 0.002234f, // FreqL[e0]
+ 0.000678f, // FreqL[e1]
+ 0.002992f, // FreqL[e2]
+ 0.003311f, // FreqL[e3]
+ 0.023416f, // FreqL[e4]
+ 0.001237f, // FreqL[e5]
+ 0.002753f, // FreqL[e6]
+ 0.005146f, // FreqL[e7]
+ 0.002194f, // FreqL[e8]
+ 0.007021f, // FreqL[e9]
+ 0.008497f, // FreqL[ea]
+ 0.013763f, // FreqL[eb]
+ 0.011768f, // FreqL[ec]
+ 0.006303f, // FreqL[ed]
+ 0.001915f, // FreqL[ee]
+ 0.000638f, // FreqL[ef]
+ 0.008776f, // FreqL[f0]
+ 0.000918f, // FreqL[f1]
+ 0.003431f, // FreqL[f2]
+ 0.057603f, // FreqL[f3]
+ 0.000439f, // FreqL[f4]
+ 0.000439f, // FreqL[f5]
+ 0.000758f, // FreqL[f6]
+ 0.002872f, // FreqL[f7]
+ 0.001675f, // FreqL[f8]
+ 0.011050f, // FreqL[f9]
+ 0.000000f, // FreqL[fa]
+ 0.000279f, // FreqL[fb]
+ 0.012127f, // FreqL[fc]
+ 0.000718f, // FreqL[fd]
+ 0.007380f // FreqL[fe]
+
+ };
+
+ mSecondByteStdDev = 0.028247f; // Trail Byte StdDev
+ mSecondByteMean = 0.010638f; // Trail Byte Mean
+ mSecondByteWeight = 0.359129f; // Trial Byte Weight
+ }
+
+}
diff --git a/src/EUCKRStatistics.java b/src/EUCKRStatistics.java
new file mode 100644
index 0000000..7d18079
--- /dev/null
+++ b/src/EUCKRStatistics.java
@@ -0,0 +1,266 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class EUCKRStatistics extends nsEUCStatistics {
+
+
+ static float[] mFirstByteFreq ;
+ static float mFirstByteStdDev;
+ static float mFirstByteMean;
+ static float mFirstByteWeight;
+ static float[] mSecondByteFreq;
+ static float mSecondByteStdDev;
+ static float mSecondByteMean;
+ static float mSecondByteWeight;
+
+ public float[] mFirstByteFreq() { return mFirstByteFreq; }
+ public float mFirstByteStdDev() { return mFirstByteStdDev; }
+ public float mFirstByteMean() { return mFirstByteMean; }
+ public float mFirstByteWeight() { return mFirstByteWeight; }
+ public float[] mSecondByteFreq() { return mSecondByteFreq; }
+ public float mSecondByteStdDev() { return mSecondByteStdDev; }
+ public float mSecondByteMean() { return mSecondByteMean; }
+ public float mSecondByteWeight() { return mSecondByteWeight; }
+
+ public EUCKRStatistics() {
+
+ mFirstByteFreq = new float[] {
+ 0.000000f, // FreqH[a1]
+ 0.000000f, // FreqH[a2]
+ 0.000000f, // FreqH[a3]
+ 0.000000f, // FreqH[a4]
+ 0.000000f, // FreqH[a5]
+ 0.000000f, // FreqH[a6]
+ 0.000000f, // FreqH[a7]
+ 0.000412f, // FreqH[a8]
+ 0.000000f, // FreqH[a9]
+ 0.000000f, // FreqH[aa]
+ 0.000000f, // FreqH[ab]
+ 0.000000f, // FreqH[ac]
+ 0.000000f, // FreqH[ad]
+ 0.000000f, // FreqH[ae]
+ 0.000000f, // FreqH[af]
+ 0.057502f, // FreqH[b0]
+ 0.033182f, // FreqH[b1]
+ 0.002267f, // FreqH[b2]
+ 0.016076f, // FreqH[b3]
+ 0.014633f, // FreqH[b4]
+ 0.032976f, // FreqH[b5]
+ 0.004122f, // FreqH[b6]
+ 0.011336f, // FreqH[b7]
+ 0.058533f, // FreqH[b8]
+ 0.024526f, // FreqH[b9]
+ 0.025969f, // FreqH[ba]
+ 0.054411f, // FreqH[bb]
+ 0.019580f, // FreqH[bc]
+ 0.063273f, // FreqH[bd]
+ 0.113974f, // FreqH[be]
+ 0.029885f, // FreqH[bf]
+ 0.150041f, // FreqH[c0]
+ 0.059151f, // FreqH[c1]
+ 0.002679f, // FreqH[c2]
+ 0.009893f, // FreqH[c3]
+ 0.014839f, // FreqH[c4]
+ 0.026381f, // FreqH[c5]
+ 0.015045f, // FreqH[c6]
+ 0.069456f, // FreqH[c7]
+ 0.089860f, // FreqH[c8]
+ 0.000000f, // FreqH[c9]
+ 0.000000f, // FreqH[ca]
+ 0.000000f, // FreqH[cb]
+ 0.000000f, // FreqH[cc]
+ 0.000000f, // FreqH[cd]
+ 0.000000f, // FreqH[ce]
+ 0.000000f, // FreqH[cf]
+ 0.000000f, // FreqH[d0]
+ 0.000000f, // FreqH[d1]
+ 0.000000f, // FreqH[d2]
+ 0.000000f, // FreqH[d3]
+ 0.000000f, // FreqH[d4]
+ 0.000000f, // FreqH[d5]
+ 0.000000f, // FreqH[d6]
+ 0.000000f, // FreqH[d7]
+ 0.000000f, // FreqH[d8]
+ 0.000000f, // FreqH[d9]
+ 0.000000f, // FreqH[da]
+ 0.000000f, // FreqH[db]
+ 0.000000f, // FreqH[dc]
+ 0.000000f, // FreqH[dd]
+ 0.000000f, // FreqH[de]
+ 0.000000f, // FreqH[df]
+ 0.000000f, // FreqH[e0]
+ 0.000000f, // FreqH[e1]
+ 0.000000f, // FreqH[e2]
+ 0.000000f, // FreqH[e3]
+ 0.000000f, // FreqH[e4]
+ 0.000000f, // FreqH[e5]
+ 0.000000f, // FreqH[e6]
+ 0.000000f, // FreqH[e7]
+ 0.000000f, // FreqH[e8]
+ 0.000000f, // FreqH[e9]
+ 0.000000f, // FreqH[ea]
+ 0.000000f, // FreqH[eb]
+ 0.000000f, // FreqH[ec]
+ 0.000000f, // FreqH[ed]
+ 0.000000f, // FreqH[ee]
+ 0.000000f, // FreqH[ef]
+ 0.000000f, // FreqH[f0]
+ 0.000000f, // FreqH[f1]
+ 0.000000f, // FreqH[f2]
+ 0.000000f, // FreqH[f3]
+ 0.000000f, // FreqH[f4]
+ 0.000000f, // FreqH[f5]
+ 0.000000f, // FreqH[f6]
+ 0.000000f, // FreqH[f7]
+ 0.000000f, // FreqH[f8]
+ 0.000000f, // FreqH[f9]
+ 0.000000f, // FreqH[fa]
+ 0.000000f, // FreqH[fb]
+ 0.000000f, // FreqH[fc]
+ 0.000000f, // FreqH[fd]
+ 0.000000f // FreqH[fe]
+
+ };
+
+ mFirstByteStdDev = 0.025593f; // Lead Byte StdDev
+ mFirstByteMean = 0.010638f; // Lead Byte Mean
+ mFirstByteWeight = 0.647437f; // Lead Byte Weight
+
+ mSecondByteFreq = new float[] {
+ 0.016694f, // FreqL[a1]
+ 0.000000f, // FreqL[a2]
+ 0.012778f, // FreqL[a3]
+ 0.030091f, // FreqL[a4]
+ 0.002679f, // FreqL[a5]
+ 0.006595f, // FreqL[a6]
+ 0.001855f, // FreqL[a7]
+ 0.000824f, // FreqL[a8]
+ 0.005977f, // FreqL[a9]
+ 0.004740f, // FreqL[aa]
+ 0.003092f, // FreqL[ab]
+ 0.000824f, // FreqL[ac]
+ 0.019580f, // FreqL[ad]
+ 0.037304f, // FreqL[ae]
+ 0.008244f, // FreqL[af]
+ 0.014633f, // FreqL[b0]
+ 0.001031f, // FreqL[b1]
+ 0.000000f, // FreqL[b2]
+ 0.003298f, // FreqL[b3]
+ 0.002061f, // FreqL[b4]
+ 0.006183f, // FreqL[b5]
+ 0.005977f, // FreqL[b6]
+ 0.000824f, // FreqL[b7]
+ 0.021847f, // FreqL[b8]
+ 0.014839f, // FreqL[b9]
+ 0.052968f, // FreqL[ba]
+ 0.017312f, // FreqL[bb]
+ 0.007626f, // FreqL[bc]
+ 0.000412f, // FreqL[bd]
+ 0.000824f, // FreqL[be]
+ 0.011129f, // FreqL[bf]
+ 0.000000f, // FreqL[c0]
+ 0.000412f, // FreqL[c1]
+ 0.001649f, // FreqL[c2]
+ 0.005977f, // FreqL[c3]
+ 0.065746f, // FreqL[c4]
+ 0.020198f, // FreqL[c5]
+ 0.021434f, // FreqL[c6]
+ 0.014633f, // FreqL[c7]
+ 0.004122f, // FreqL[c8]
+ 0.001649f, // FreqL[c9]
+ 0.000824f, // FreqL[ca]
+ 0.000824f, // FreqL[cb]
+ 0.051937f, // FreqL[cc]
+ 0.019580f, // FreqL[cd]
+ 0.023289f, // FreqL[ce]
+ 0.026381f, // FreqL[cf]
+ 0.040396f, // FreqL[d0]
+ 0.009068f, // FreqL[d1]
+ 0.001443f, // FreqL[d2]
+ 0.003710f, // FreqL[d3]
+ 0.007420f, // FreqL[d4]
+ 0.001443f, // FreqL[d5]
+ 0.013190f, // FreqL[d6]
+ 0.002885f, // FreqL[d7]
+ 0.000412f, // FreqL[d8]
+ 0.003298f, // FreqL[d9]
+ 0.025969f, // FreqL[da]
+ 0.000412f, // FreqL[db]
+ 0.000412f, // FreqL[dc]
+ 0.006183f, // FreqL[dd]
+ 0.003298f, // FreqL[de]
+ 0.066983f, // FreqL[df]
+ 0.002679f, // FreqL[e0]
+ 0.002267f, // FreqL[e1]
+ 0.011129f, // FreqL[e2]
+ 0.000412f, // FreqL[e3]
+ 0.010099f, // FreqL[e4]
+ 0.015251f, // FreqL[e5]
+ 0.007626f, // FreqL[e6]
+ 0.043899f, // FreqL[e7]
+ 0.003710f, // FreqL[e8]
+ 0.002679f, // FreqL[e9]
+ 0.001443f, // FreqL[ea]
+ 0.010923f, // FreqL[eb]
+ 0.002885f, // FreqL[ec]
+ 0.009068f, // FreqL[ed]
+ 0.019992f, // FreqL[ee]
+ 0.000412f, // FreqL[ef]
+ 0.008450f, // FreqL[f0]
+ 0.005153f, // FreqL[f1]
+ 0.000000f, // FreqL[f2]
+ 0.010099f, // FreqL[f3]
+ 0.000000f, // FreqL[f4]
+ 0.001649f, // FreqL[f5]
+ 0.012160f, // FreqL[f6]
+ 0.011542f, // FreqL[f7]
+ 0.006595f, // FreqL[f8]
+ 0.001855f, // FreqL[f9]
+ 0.010923f, // FreqL[fa]
+ 0.000412f, // FreqL[fb]
+ 0.023702f, // FreqL[fc]
+ 0.003710f, // FreqL[fd]
+ 0.001855f // FreqL[fe]
+
+ };
+
+ mSecondByteStdDev = 0.013937f; // Trail Byte StdDev
+ mSecondByteMean = 0.010638f; // Trail Byte Mean
+ mSecondByteWeight = 0.352563f; // Trial Byte Weight
+ }
+
+}
diff --git a/src/EUCTWStatistics.java b/src/EUCTWStatistics.java
new file mode 100644
index 0000000..54a0ad7
--- /dev/null
+++ b/src/EUCTWStatistics.java
@@ -0,0 +1,264 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class EUCTWStatistics extends nsEUCStatistics {
+
+
+ static float[] mFirstByteFreq ;
+ static float mFirstByteStdDev;
+ static float mFirstByteMean;
+ static float mFirstByteWeight;
+ static float[] mSecondByteFreq;
+ static float mSecondByteStdDev;
+ static float mSecondByteMean;
+ static float mSecondByteWeight;
+
+ public float[] mFirstByteFreq() { return mFirstByteFreq; }
+ public float mFirstByteStdDev() { return mFirstByteStdDev; }
+ public float mFirstByteMean() { return mFirstByteMean; }
+ public float mFirstByteWeight() { return mFirstByteWeight; }
+ public float[] mSecondByteFreq() { return mSecondByteFreq; }
+ public float mSecondByteStdDev() { return mSecondByteStdDev; }
+ public float mSecondByteMean() { return mSecondByteMean; }
+ public float mSecondByteWeight() { return mSecondByteWeight; }
+
+ public EUCTWStatistics() {
+
+ mFirstByteFreq = new float[] {
+ 0.000000f, // FreqH[a1]
+ 0.000000f, // FreqH[a2]
+ 0.000000f, // FreqH[a3]
+ 0.000000f, // FreqH[a4]
+ 0.000000f, // FreqH[a5]
+ 0.000000f, // FreqH[a6]
+ 0.000000f, // FreqH[a7]
+ 0.000000f, // FreqH[a8]
+ 0.000000f, // FreqH[a9]
+ 0.000000f, // FreqH[aa]
+ 0.000000f, // FreqH[ab]
+ 0.000000f, // FreqH[ac]
+ 0.000000f, // FreqH[ad]
+ 0.000000f, // FreqH[ae]
+ 0.000000f, // FreqH[af]
+ 0.000000f, // FreqH[b0]
+ 0.000000f, // FreqH[b1]
+ 0.000000f, // FreqH[b2]
+ 0.000000f, // FreqH[b3]
+ 0.000000f, // FreqH[b4]
+ 0.000000f, // FreqH[b5]
+ 0.000000f, // FreqH[b6]
+ 0.000000f, // FreqH[b7]
+ 0.000000f, // FreqH[b8]
+ 0.000000f, // FreqH[b9]
+ 0.000000f, // FreqH[ba]
+ 0.000000f, // FreqH[bb]
+ 0.000000f, // FreqH[bc]
+ 0.000000f, // FreqH[bd]
+ 0.000000f, // FreqH[be]
+ 0.000000f, // FreqH[bf]
+ 0.000000f, // FreqH[c0]
+ 0.000000f, // FreqH[c1]
+ 0.000000f, // FreqH[c2]
+ 0.000000f, // FreqH[c3]
+ 0.119286f, // FreqH[c4]
+ 0.052233f, // FreqH[c5]
+ 0.044126f, // FreqH[c6]
+ 0.052494f, // FreqH[c7]
+ 0.045906f, // FreqH[c8]
+ 0.019038f, // FreqH[c9]
+ 0.032465f, // FreqH[ca]
+ 0.026252f, // FreqH[cb]
+ 0.025502f, // FreqH[cc]
+ 0.015963f, // FreqH[cd]
+ 0.052493f, // FreqH[ce]
+ 0.019256f, // FreqH[cf]
+ 0.015137f, // FreqH[d0]
+ 0.031782f, // FreqH[d1]
+ 0.017370f, // FreqH[d2]
+ 0.018494f, // FreqH[d3]
+ 0.015575f, // FreqH[d4]
+ 0.016621f, // FreqH[d5]
+ 0.007444f, // FreqH[d6]
+ 0.011642f, // FreqH[d7]
+ 0.013916f, // FreqH[d8]
+ 0.019159f, // FreqH[d9]
+ 0.016445f, // FreqH[da]
+ 0.007851f, // FreqH[db]
+ 0.011079f, // FreqH[dc]
+ 0.022842f, // FreqH[dd]
+ 0.015513f, // FreqH[de]
+ 0.010033f, // FreqH[df]
+ 0.009950f, // FreqH[e0]
+ 0.010347f, // FreqH[e1]
+ 0.013103f, // FreqH[e2]
+ 0.015371f, // FreqH[e3]
+ 0.012502f, // FreqH[e4]
+ 0.007436f, // FreqH[e5]
+ 0.018253f, // FreqH[e6]
+ 0.014134f, // FreqH[e7]
+ 0.008907f, // FreqH[e8]
+ 0.005411f, // FreqH[e9]
+ 0.009570f, // FreqH[ea]
+ 0.013598f, // FreqH[eb]
+ 0.006092f, // FreqH[ec]
+ 0.007409f, // FreqH[ed]
+ 0.008432f, // FreqH[ee]
+ 0.005816f, // FreqH[ef]
+ 0.009349f, // FreqH[f0]
+ 0.005472f, // FreqH[f1]
+ 0.007170f, // FreqH[f2]
+ 0.007420f, // FreqH[f3]
+ 0.003681f, // FreqH[f4]
+ 0.007523f, // FreqH[f5]
+ 0.004610f, // FreqH[f6]
+ 0.006154f, // FreqH[f7]
+ 0.003348f, // FreqH[f8]
+ 0.005074f, // FreqH[f9]
+ 0.005922f, // FreqH[fa]
+ 0.005254f, // FreqH[fb]
+ 0.004682f, // FreqH[fc]
+ 0.002093f, // FreqH[fd]
+ 0.000000f // FreqH[fe]
+ };
+
+ mFirstByteStdDev = 0.016681f; // Lead Byte StdDev
+ mFirstByteMean = 0.010638f; // Lead Byte Mean
+ mFirstByteWeight = 0.715599f; // Lead Byte Weight
+
+ mSecondByteFreq = new float[] {
+ 0.028933f, // FreqL[a1]
+ 0.011371f, // FreqL[a2]
+ 0.011053f, // FreqL[a3]
+ 0.007232f, // FreqL[a4]
+ 0.010192f, // FreqL[a5]
+ 0.004093f, // FreqL[a6]
+ 0.015043f, // FreqL[a7]
+ 0.011752f, // FreqL[a8]
+ 0.022387f, // FreqL[a9]
+ 0.008410f, // FreqL[aa]
+ 0.012448f, // FreqL[ab]
+ 0.007473f, // FreqL[ac]
+ 0.003594f, // FreqL[ad]
+ 0.007139f, // FreqL[ae]
+ 0.018912f, // FreqL[af]
+ 0.006083f, // FreqL[b0]
+ 0.003302f, // FreqL[b1]
+ 0.010215f, // FreqL[b2]
+ 0.008791f, // FreqL[b3]
+ 0.024236f, // FreqL[b4]
+ 0.014107f, // FreqL[b5]
+ 0.014108f, // FreqL[b6]
+ 0.010303f, // FreqL[b7]
+ 0.009728f, // FreqL[b8]
+ 0.007877f, // FreqL[b9]
+ 0.009719f, // FreqL[ba]
+ 0.007952f, // FreqL[bb]
+ 0.021028f, // FreqL[bc]
+ 0.005764f, // FreqL[bd]
+ 0.009341f, // FreqL[be]
+ 0.006591f, // FreqL[bf]
+ 0.012517f, // FreqL[c0]
+ 0.005921f, // FreqL[c1]
+ 0.008982f, // FreqL[c2]
+ 0.008771f, // FreqL[c3]
+ 0.012802f, // FreqL[c4]
+ 0.005926f, // FreqL[c5]
+ 0.008342f, // FreqL[c6]
+ 0.003086f, // FreqL[c7]
+ 0.006843f, // FreqL[c8]
+ 0.007576f, // FreqL[c9]
+ 0.004734f, // FreqL[ca]
+ 0.016404f, // FreqL[cb]
+ 0.008803f, // FreqL[cc]
+ 0.008071f, // FreqL[cd]
+ 0.005349f, // FreqL[ce]
+ 0.008566f, // FreqL[cf]
+ 0.010840f, // FreqL[d0]
+ 0.015401f, // FreqL[d1]
+ 0.031904f, // FreqL[d2]
+ 0.008670f, // FreqL[d3]
+ 0.011479f, // FreqL[d4]
+ 0.010936f, // FreqL[d5]
+ 0.007617f, // FreqL[d6]
+ 0.008995f, // FreqL[d7]
+ 0.008114f, // FreqL[d8]
+ 0.008658f, // FreqL[d9]
+ 0.005934f, // FreqL[da]
+ 0.010452f, // FreqL[db]
+ 0.009142f, // FreqL[dc]
+ 0.004519f, // FreqL[dd]
+ 0.008339f, // FreqL[de]
+ 0.007476f, // FreqL[df]
+ 0.007027f, // FreqL[e0]
+ 0.006025f, // FreqL[e1]
+ 0.021804f, // FreqL[e2]
+ 0.024248f, // FreqL[e3]
+ 0.015895f, // FreqL[e4]
+ 0.003768f, // FreqL[e5]
+ 0.010171f, // FreqL[e6]
+ 0.010007f, // FreqL[e7]
+ 0.010178f, // FreqL[e8]
+ 0.008316f, // FreqL[e9]
+ 0.006832f, // FreqL[ea]
+ 0.006364f, // FreqL[eb]
+ 0.009141f, // FreqL[ec]
+ 0.009148f, // FreqL[ed]
+ 0.012081f, // FreqL[ee]
+ 0.011914f, // FreqL[ef]
+ 0.004464f, // FreqL[f0]
+ 0.014257f, // FreqL[f1]
+ 0.006907f, // FreqL[f2]
+ 0.011292f, // FreqL[f3]
+ 0.018622f, // FreqL[f4]
+ 0.008149f, // FreqL[f5]
+ 0.004636f, // FreqL[f6]
+ 0.006612f, // FreqL[f7]
+ 0.013478f, // FreqL[f8]
+ 0.012614f, // FreqL[f9]
+ 0.005186f, // FreqL[fa]
+ 0.048285f, // FreqL[fb]
+ 0.006816f, // FreqL[fc]
+ 0.006743f, // FreqL[fd]
+ 0.008671f // FreqL[fe]
+ };
+
+ mSecondByteStdDev = 0.006630f; // Trail Byte StdDev
+ mSecondByteMean = 0.010638f; // Trail Byte Mean
+ mSecondByteWeight = 0.284401f; // Trial Byte Weight
+ }
+
+}
diff --git a/src/GB2312Statistics.java b/src/GB2312Statistics.java
new file mode 100644
index 0000000..cc54d22
--- /dev/null
+++ b/src/GB2312Statistics.java
@@ -0,0 +1,266 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class GB2312Statistics extends nsEUCStatistics {
+
+
+ static float[] mFirstByteFreq ;
+ static float mFirstByteStdDev;
+ static float mFirstByteMean;
+ static float mFirstByteWeight;
+ static float[] mSecondByteFreq;
+ static float mSecondByteStdDev;
+ static float mSecondByteMean;
+ static float mSecondByteWeight;
+
+ public float[] mFirstByteFreq() { return mFirstByteFreq; }
+ public float mFirstByteStdDev() { return mFirstByteStdDev; }
+ public float mFirstByteMean() { return mFirstByteMean; }
+ public float mFirstByteWeight() { return mFirstByteWeight; }
+ public float[] mSecondByteFreq() { return mSecondByteFreq; }
+ public float mSecondByteStdDev() { return mSecondByteStdDev; }
+ public float mSecondByteMean() { return mSecondByteMean; }
+ public float mSecondByteWeight() { return mSecondByteWeight; }
+
+ public GB2312Statistics() {
+
+ mFirstByteFreq = new float[] {
+ 0.011628f, // FreqH[a1]
+ 0.000000f, // FreqH[a2]
+ 0.000000f, // FreqH[a3]
+ 0.000000f, // FreqH[a4]
+ 0.000000f, // FreqH[a5]
+ 0.000000f, // FreqH[a6]
+ 0.000000f, // FreqH[a7]
+ 0.000000f, // FreqH[a8]
+ 0.000000f, // FreqH[a9]
+ 0.000000f, // FreqH[aa]
+ 0.000000f, // FreqH[ab]
+ 0.000000f, // FreqH[ac]
+ 0.000000f, // FreqH[ad]
+ 0.000000f, // FreqH[ae]
+ 0.000000f, // FreqH[af]
+ 0.011628f, // FreqH[b0]
+ 0.012403f, // FreqH[b1]
+ 0.009302f, // FreqH[b2]
+ 0.003876f, // FreqH[b3]
+ 0.017829f, // FreqH[b4]
+ 0.037209f, // FreqH[b5]
+ 0.008527f, // FreqH[b6]
+ 0.010078f, // FreqH[b7]
+ 0.019380f, // FreqH[b8]
+ 0.054264f, // FreqH[b9]
+ 0.010078f, // FreqH[ba]
+ 0.041085f, // FreqH[bb]
+ 0.020930f, // FreqH[bc]
+ 0.018605f, // FreqH[bd]
+ 0.010078f, // FreqH[be]
+ 0.013178f, // FreqH[bf]
+ 0.016279f, // FreqH[c0]
+ 0.006202f, // FreqH[c1]
+ 0.009302f, // FreqH[c2]
+ 0.017054f, // FreqH[c3]
+ 0.011628f, // FreqH[c4]
+ 0.008527f, // FreqH[c5]
+ 0.004651f, // FreqH[c6]
+ 0.006202f, // FreqH[c7]
+ 0.017829f, // FreqH[c8]
+ 0.024806f, // FreqH[c9]
+ 0.020155f, // FreqH[ca]
+ 0.013953f, // FreqH[cb]
+ 0.032558f, // FreqH[cc]
+ 0.035659f, // FreqH[cd]
+ 0.068217f, // FreqH[ce]
+ 0.010853f, // FreqH[cf]
+ 0.036434f, // FreqH[d0]
+ 0.117054f, // FreqH[d1]
+ 0.027907f, // FreqH[d2]
+ 0.100775f, // FreqH[d3]
+ 0.010078f, // FreqH[d4]
+ 0.017829f, // FreqH[d5]
+ 0.062016f, // FreqH[d6]
+ 0.012403f, // FreqH[d7]
+ 0.000000f, // FreqH[d8]
+ 0.000000f, // FreqH[d9]
+ 0.000000f, // FreqH[da]
+ 0.000000f, // FreqH[db]
+ 0.000000f, // FreqH[dc]
+ 0.000000f, // FreqH[dd]
+ 0.000000f, // FreqH[de]
+ 0.000000f, // FreqH[df]
+ 0.000000f, // FreqH[e0]
+ 0.000000f, // FreqH[e1]
+ 0.000000f, // FreqH[e2]
+ 0.000000f, // FreqH[e3]
+ 0.000000f, // FreqH[e4]
+ 0.000000f, // FreqH[e5]
+ 0.000000f, // FreqH[e6]
+ 0.000000f, // FreqH[e7]
+ 0.000000f, // FreqH[e8]
+ 0.000000f, // FreqH[e9]
+ 0.001550f, // FreqH[ea]
+ 0.000000f, // FreqH[eb]
+ 0.000000f, // FreqH[ec]
+ 0.000000f, // FreqH[ed]
+ 0.000000f, // FreqH[ee]
+ 0.000000f, // FreqH[ef]
+ 0.000000f, // FreqH[f0]
+ 0.000000f, // FreqH[f1]
+ 0.000000f, // FreqH[f2]
+ 0.000000f, // FreqH[f3]
+ 0.000000f, // FreqH[f4]
+ 0.000000f, // FreqH[f5]
+ 0.000000f, // FreqH[f6]
+ 0.000000f, // FreqH[f7]
+ 0.000000f, // FreqH[f8]
+ 0.000000f, // FreqH[f9]
+ 0.000000f, // FreqH[fa]
+ 0.000000f, // FreqH[fb]
+ 0.000000f, // FreqH[fc]
+ 0.000000f, // FreqH[fd]
+ 0.000000f // FreqH[fe]
+
+ };
+
+ mFirstByteStdDev = 0.020081f; // Lead Byte StdDev
+ mFirstByteMean = 0.010638f; // Lead Byte Mean
+ mFirstByteWeight = 0.586533f; // Lead Byte Weight
+
+ mSecondByteFreq = new float[] {
+ 0.006202f, // FreqL[a1]
+ 0.031008f, // FreqL[a2]
+ 0.005426f, // FreqL[a3]
+ 0.003101f, // FreqL[a4]
+ 0.001550f, // FreqL[a5]
+ 0.003101f, // FreqL[a6]
+ 0.082171f, // FreqL[a7]
+ 0.014729f, // FreqL[a8]
+ 0.006977f, // FreqL[a9]
+ 0.001550f, // FreqL[aa]
+ 0.013953f, // FreqL[ab]
+ 0.000000f, // FreqL[ac]
+ 0.013953f, // FreqL[ad]
+ 0.010078f, // FreqL[ae]
+ 0.008527f, // FreqL[af]
+ 0.006977f, // FreqL[b0]
+ 0.004651f, // FreqL[b1]
+ 0.003101f, // FreqL[b2]
+ 0.003101f, // FreqL[b3]
+ 0.003101f, // FreqL[b4]
+ 0.008527f, // FreqL[b5]
+ 0.003101f, // FreqL[b6]
+ 0.005426f, // FreqL[b7]
+ 0.005426f, // FreqL[b8]
+ 0.005426f, // FreqL[b9]
+ 0.003101f, // FreqL[ba]
+ 0.001550f, // FreqL[bb]
+ 0.006202f, // FreqL[bc]
+ 0.014729f, // FreqL[bd]
+ 0.010853f, // FreqL[be]
+ 0.000000f, // FreqL[bf]
+ 0.011628f, // FreqL[c0]
+ 0.000000f, // FreqL[c1]
+ 0.031783f, // FreqL[c2]
+ 0.013953f, // FreqL[c3]
+ 0.030233f, // FreqL[c4]
+ 0.039535f, // FreqL[c5]
+ 0.008527f, // FreqL[c6]
+ 0.015504f, // FreqL[c7]
+ 0.000000f, // FreqL[c8]
+ 0.003101f, // FreqL[c9]
+ 0.008527f, // FreqL[ca]
+ 0.016279f, // FreqL[cb]
+ 0.005426f, // FreqL[cc]
+ 0.001550f, // FreqL[cd]
+ 0.013953f, // FreqL[ce]
+ 0.013953f, // FreqL[cf]
+ 0.044961f, // FreqL[d0]
+ 0.003101f, // FreqL[d1]
+ 0.004651f, // FreqL[d2]
+ 0.006977f, // FreqL[d3]
+ 0.001550f, // FreqL[d4]
+ 0.005426f, // FreqL[d5]
+ 0.012403f, // FreqL[d6]
+ 0.001550f, // FreqL[d7]
+ 0.015504f, // FreqL[d8]
+ 0.000000f, // FreqL[d9]
+ 0.006202f, // FreqL[da]
+ 0.001550f, // FreqL[db]
+ 0.000000f, // FreqL[dc]
+ 0.007752f, // FreqL[dd]
+ 0.006977f, // FreqL[de]
+ 0.001550f, // FreqL[df]
+ 0.009302f, // FreqL[e0]
+ 0.011628f, // FreqL[e1]
+ 0.004651f, // FreqL[e2]
+ 0.010853f, // FreqL[e3]
+ 0.012403f, // FreqL[e4]
+ 0.017829f, // FreqL[e5]
+ 0.005426f, // FreqL[e6]
+ 0.024806f, // FreqL[e7]
+ 0.000000f, // FreqL[e8]
+ 0.006202f, // FreqL[e9]
+ 0.000000f, // FreqL[ea]
+ 0.082171f, // FreqL[eb]
+ 0.015504f, // FreqL[ec]
+ 0.004651f, // FreqL[ed]
+ 0.000000f, // FreqL[ee]
+ 0.006977f, // FreqL[ef]
+ 0.004651f, // FreqL[f0]
+ 0.000000f, // FreqL[f1]
+ 0.008527f, // FreqL[f2]
+ 0.012403f, // FreqL[f3]
+ 0.004651f, // FreqL[f4]
+ 0.003876f, // FreqL[f5]
+ 0.003101f, // FreqL[f6]
+ 0.022481f, // FreqL[f7]
+ 0.024031f, // FreqL[f8]
+ 0.001550f, // FreqL[f9]
+ 0.047287f, // FreqL[fa]
+ 0.009302f, // FreqL[fb]
+ 0.001550f, // FreqL[fc]
+ 0.005426f, // FreqL[fd]
+ 0.017054f // FreqL[fe]
+
+ };
+
+ mSecondByteStdDev = 0.014156f; // Trail Byte StdDev
+ mSecondByteMean = 0.010638f; // Trail Byte Mean
+ mSecondByteWeight = 0.413467f; // Trial Byte Weight
+ }
+
+}
diff --git a/src/HtmlCharsetDetector.java b/src/HtmlCharsetDetector.java
new file mode 100644
index 0000000..a85cd1e
--- /dev/null
+++ b/src/HtmlCharsetDetector.java
@@ -0,0 +1,118 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+import java.io.* ;
+import java.net.* ;
+import java.util.* ;
+import org.mozilla.intl.chardet.* ;
+
+public class HtmlCharsetDetector {
+
+ public static boolean found = false ;
+
+ public static void main(String argv[]) throws Exception {
+
+ if (argv.length != 1 && argv.length != 2) {
+
+ System.out.println(
+ "Usage: HtmlCharsetDetector <url> [<languageHint>]");
+
+ System.out.println("");
+ System.out.println("Where <url> is http://...");
+ System.out.println("For optional <languageHint>. Use following...");
+ System.out.println(" 1 => Japanese");
+ System.out.println(" 2 => Chinese");
+ System.out.println(" 3 => Simplified Chinese");
+ System.out.println(" 4 => Traditional Chinese");
+ System.out.println(" 5 => Korean");
+ System.out.println(" 6 => Dont know (default)");
+
+ return ;
+ }
+
+
+ // Initalize the nsDetector() ;
+ int lang = (argv.length == 2)? Integer.parseInt(argv[1])
+ : nsPSMDetector.ALL ;
+ nsDetector det = new nsDetector(lang) ;
+
+ // Set an observer...
+ // The Notify() will be called when a matching charset is found.
+
+ det.Init(new nsICharsetDetectionObserver() {
+ public void Notify(String charset) {
+ HtmlCharsetDetector.found = true ;
+ System.out.println("CHARSET = " + charset);
+ }
+ });
+
+ URL url = new URL(argv[0]);
+ BufferedInputStream imp = new BufferedInputStream(url.openStream());
+
+ byte[] buf = new byte[1024] ;
+ int len;
+ boolean done = false ;
+ boolean isAscii = true ;
+
+ while( (len=imp.read(buf,0,buf.length)) != -1) {
+
+ // Check if the stream is only ascii.
+ if (isAscii)
+ isAscii = det.isAscii(buf,len);
+
+ // DoIt if non-ascii and not done yet.
+ if (!isAscii && !done)
+ done = det.DoIt(buf,len, false);
+ }
+ det.DataEnd();
+
+ if (isAscii) {
+ System.out.println("CHARSET = ASCII");
+ found = true ;
+ }
+
+ if (!found) {
+ String prob[] = det.getProbableCharsets() ;
+ for(int i=0; i<prob.length; i++) {
+ System.out.println("Probable Charset = " + prob[i]);
+ }
+ }
+ }
+}
diff --git a/src/nsBIG5Verifier.java b/src/nsBIG5Verifier.java
new file mode 100644
index 0000000..e75b567
--- /dev/null
+++ b/src/nsBIG5Verifier.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsBIG5Verifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsBIG5Verifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (4))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+
+
+
+ states = new int[3] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "Big5";
+ stFactor = 5;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsCP1252Verifier.java b/src/nsCP1252Verifier.java
new file mode 100644
index 0000000..4212493
--- /dev/null
+++ b/src/nsCP1252Verifier.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsCP1252Verifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsCP1252Verifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (1))) ) << 8) | (((int)(((0) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (1))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((0) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (1))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+
+
+
+ states = new int[3] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)((( 3) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | ( 4))) ) << 8) | ( ((int)(((eError) << 4) | (eItsMe))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)((( 4) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "windows-1252";
+ stFactor = 3;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsDetector.java b/src/nsDetector.java
new file mode 100644
index 0000000..4d1c90a
--- /dev/null
+++ b/src/nsDetector.java
@@ -0,0 +1,86 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public class nsDetector extends nsPSMDetector
+ implements nsICharsetDetector {
+
+ nsICharsetDetectionObserver mObserver = null ;
+
+ public nsDetector() {
+ super() ;
+ }
+
+ public nsDetector(int langFlag) {
+ super(langFlag) ;
+ }
+
+ public void Init(nsICharsetDetectionObserver aObserver) {
+
+ mObserver = aObserver ;
+ return ;
+
+ }
+
+ public boolean DoIt(byte[] aBuf, int aLen, boolean oDontFeedMe) {
+
+ if (aBuf == null || oDontFeedMe )
+ return false ;
+
+ this.HandleData(aBuf, aLen) ;
+ return mDone ;
+ }
+
+ public void Done() {
+ this.DataEnd() ;
+ return ;
+ }
+
+ public void Report(String charset) {
+ if (mObserver != null)
+ mObserver.Notify(charset) ;
+ }
+
+ public boolean isAscii(byte[] aBuf, int aLen) {
+
+ for(int i=0; i<aLen; i++) {
+ if ((0x0080 & aBuf[i]) != 0) {
+ return false ;
+ }
+ }
+ return true ;
+ }
+}
diff --git a/src/nsEUCJPVerifier.java b/src/nsEUCJPVerifier.java
new file mode 100644
index 0000000..29aecdb
--- /dev/null
+++ b/src/nsEUCJPVerifier.java
@@ -0,0 +1,113 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsEUCJPVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsEUCJPVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 3) << 4) | (1))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (5))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+
+
+
+ states = new int[5] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 3))) ) << 8) | ( ((int)((( 4) << 4) | ( 3))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 3))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | ( 3))) )))))) ;
+
+
+
+ charset = "EUC-JP";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsEUCKRVerifier.java b/src/nsEUCKRVerifier.java
new file mode 100644
index 0000000..71cba05
--- /dev/null
+++ b/src/nsEUCKRVerifier.java
@@ -0,0 +1,110 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsEUCKRVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsEUCKRVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((3) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+
+
+
+ states = new int[2] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 3))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+
+
+
+ charset = "EUC-KR";
+ stFactor = 4;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsEUCSampler.java b/src/nsEUCSampler.java
new file mode 100644
index 0000000..867bb5f
--- /dev/null
+++ b/src/nsEUCSampler.java
@@ -0,0 +1,139 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+import java.lang.* ;
+
+public class nsEUCSampler {
+
+ int mTotal = 0;
+ int mThreshold = 200 ;
+ int mState = 0;
+ public int mFirstByteCnt[] = new int[94] ;
+ public int mSecondByteCnt[] = new int[94] ;
+ public float mFirstByteFreq[] = new float[94] ;
+ public float mSecondByteFreq[] = new float[94];
+
+ public nsEUCSampler() {
+ Reset() ;
+ }
+
+ public void Reset() {
+ mTotal = 0 ;
+ mState = 0 ;
+ for(int i=0; i<94; i++)
+ mFirstByteCnt[i] = mSecondByteCnt[i] = 0 ;
+ }
+
+ boolean EnoughData() { return mTotal > mThreshold; }
+
+ boolean GetSomeData() { return mTotal > 1; }
+
+ boolean Sample(byte[] aIn, int aLen) {
+
+ if(mState == 1)
+ return false;
+
+ int p = 0;
+
+ // if(aLen + mTotal > 0x80000000)
+ // aLen = 0x80000000 - mTotal;
+
+ int i;
+ for(i=0; (i<aLen) && (1 != mState) ;i++,p++)
+ {
+ switch(mState) {
+ case 0:
+ if( ( aIn[p] & 0x0080 ) != 0 )
+ {
+ if((0xff==(0xff&aIn[p])) || ( 0xa1>(0xff&aIn[p]))) {
+ mState = 1;
+ } else {
+ mTotal++;
+ mFirstByteCnt[(0xff&aIn[p]) - 0xa1]++;
+ mState = 2;
+ }
+ }
+ break;
+ case 1:
+ break;
+ case 2:
+ if( (aIn[p] & 0x0080) != 0 )
+ {
+ if((0xff == (0xff&aIn[p]))
+ || ( 0xa1 > (0xff&aIn[p]))) {
+ mState = 1;
+ } else {
+ mTotal++;
+ mSecondByteCnt[(0xff&aIn[p]) - 0xa1]++;
+ mState = 0;
+ }
+ } else {
+ mState = 1;
+ }
+ break;
+ default:
+ mState = 1;
+ }
+ }
+ return (1 != mState );
+ }
+
+
+ void CalFreq() {
+ for(int i = 0 ; i < 94; i++) {
+ mFirstByteFreq[i] = (float)mFirstByteCnt[i] / (float)mTotal;
+ mSecondByteFreq[i] = (float)mSecondByteCnt[i] / (float)mTotal;
+ }
+ }
+
+ float GetScore(float[] aFirstByteFreq, float aFirstByteWeight,
+ float[] aSecondByteFreq, float aSecondByteWeight)
+ {
+ return aFirstByteWeight * GetScore(aFirstByteFreq, mFirstByteFreq) +
+ aSecondByteWeight * GetScore(aSecondByteFreq, mSecondByteFreq);
+ }
+
+ float GetScore(float[] array1, float[] array2) {
+ float s;
+ float sum=0.0f;
+
+ for(int i=0;i<94;i++) {
+ s = array1[i] - array2[i];
+ sum += s * s;
+ }
+ return (float)java.lang.Math.sqrt((double)sum) / 94.0f;
+ }
+}
+
+
diff --git a/src/nsEUCStatistics.java b/src/nsEUCStatistics.java
new file mode 100644
index 0000000..0c0a120
--- /dev/null
+++ b/src/nsEUCStatistics.java
@@ -0,0 +1,52 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public abstract class nsEUCStatistics {
+
+ public abstract float[] mFirstByteFreq() ;
+ public abstract float mFirstByteStdDev();
+ public abstract float mFirstByteMean();
+ public abstract float mFirstByteWeight();
+ public abstract float[] mSecondByteFreq();
+ public abstract float mSecondByteStdDev();
+ public abstract float mSecondByteMean();
+ public abstract float mSecondByteWeight();
+
+ public nsEUCStatistics() {
+ }
+
+}
diff --git a/src/nsEUCTWVerifier.java b/src/nsEUCTWVerifier.java
new file mode 100644
index 0000000..a25860d
--- /dev/null
+++ b/src/nsEUCTWVerifier.java
@@ -0,0 +1,114 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsEUCTWVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsEUCTWVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (6))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (3))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+
+
+
+ states = new int[6] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eStart))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | ( 5))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ;
+
+
+
+ charset = "x-euc-tw";
+ stFactor = 7;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsGB18030Verifier.java b/src/nsGB18030Verifier.java
new file mode 100644
index 0000000..9f16229
--- /dev/null
+++ b/src/nsGB18030Verifier.java
@@ -0,0 +1,114 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsGB18030Verifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsGB18030Verifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 4) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (5))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+
+
+
+ states = new int[6] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 3))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | ( 4))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "GB18030";
+ stFactor = 7;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsGB2312Verifier.java b/src/nsGB2312Verifier.java
new file mode 100644
index 0000000..cb21b6b
--- /dev/null
+++ b/src/nsGB2312Verifier.java
@@ -0,0 +1,110 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsGB2312Verifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsGB2312Verifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (0))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+
+
+
+ states = new int[2] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 3))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+
+
+
+ charset = "GB2312";
+ stFactor = 4;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsHZVerifier.java b/src/nsHZVerifier.java
new file mode 100644
index 0000000..1f16b13
--- /dev/null
+++ b/src/nsHZVerifier.java
@@ -0,0 +1,114 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsHZVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsHZVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (2))) ) << 8) | (((int)(((5) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+
+
+
+ states = new int[6] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | ( 3))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 6))) ) << 8) | ( ((int)(((eError) << 4) | ( 5))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eError) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)((( 4) << 4) | ( 4))) ) << 8) | ( ((int)(((eError) << 4) | ( 4))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eItsMe) << 4) | ( 4))) )))))) ;
+
+
+
+ charset = "HZ-GB-2312";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsICharsetDetectionObserver.java b/src/nsICharsetDetectionObserver.java
new file mode 100644
index 0000000..dae4701
--- /dev/null
+++ b/src/nsICharsetDetectionObserver.java
@@ -0,0 +1,42 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public interface nsICharsetDetectionObserver {
+
+ public void Notify(String charset) ;
+}
+
diff --git a/src/nsICharsetDetector.java b/src/nsICharsetDetector.java
new file mode 100644
index 0000000..05aa2eb
--- /dev/null
+++ b/src/nsICharsetDetector.java
@@ -0,0 +1,44 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.* ;
+
+public interface nsICharsetDetector {
+
+ public void Init(nsICharsetDetectionObserver observer) ;
+ public boolean DoIt(byte[] aBuf, int aLen, boolean oDontFeedMe) ;
+ public void Done() ;
+}
+
diff --git a/src/nsISO2022CNVerifier.java b/src/nsISO2022CNVerifier.java
new file mode 100644
index 0000000..b34a7f6
--- /dev/null
+++ b/src/nsISO2022CNVerifier.java
@@ -0,0 +1,116 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsISO2022CNVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsISO2022CNVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+
+
+
+ states = new int[8] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eStart))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 4))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)((( 6) << 4) | ( 5))) )))))) ;
+ states[6] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[7] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eError))) ) << 8) | (((int)(((eItsMe) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "ISO-2022-CN";
+ stFactor = 9;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsISO2022JPVerifier.java b/src/nsISO2022JPVerifier.java
new file mode 100644
index 0000000..c3c7eea
--- /dev/null
+++ b/src/nsISO2022JPVerifier.java
@@ -0,0 +1,114 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsISO2022JPVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsISO2022JPVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (3))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (4))) ) << 8) | ( ((int)(((0) << 4) | (6))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (5))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+
+
+
+ states = new int[6] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( 4) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "ISO-2022-JP";
+ stFactor = 8;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsISO2022KRVerifier.java b/src/nsISO2022KRVerifier.java
new file mode 100644
index 0000000..c4edde1
--- /dev/null
+++ b/src/nsISO2022KRVerifier.java
@@ -0,0 +1,113 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsISO2022KRVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsISO2022KRVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (2))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((4) << 4) | (0))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+
+
+
+ states = new int[5] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eError))) ) << 8) | ( ((int)((( 3) << 4) | (eStart))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 4) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "ISO-2022-KR";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsPSMDetector.java b/src/nsPSMDetector.java
new file mode 100644
index 0000000..efbfb70
--- /dev/null
+++ b/src/nsPSMDetector.java
@@ -0,0 +1,421 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+import java.lang.* ;
+
+public abstract class nsPSMDetector {
+
+ public static final int ALL = 0 ;
+ public static final int JAPANESE = 1 ;
+ public static final int CHINESE = 2 ;
+ public static final int SIMPLIFIED_CHINESE = 3 ;
+ public static final int TRADITIONAL_CHINESE = 4 ;
+ public static final int KOREAN = 5 ;
+
+ public static final int NO_OF_LANGUAGES = 6 ;
+ public static final int MAX_VERIFIERS = 16 ;
+
+ nsVerifier[] mVerifier ;
+ nsEUCStatistics[] mStatisticsData ;
+
+ nsEUCSampler mSampler = new nsEUCSampler() ;
+ byte[] mState = new byte[MAX_VERIFIERS] ;
+ int[] mItemIdx = new int[MAX_VERIFIERS] ;
+
+ int mItems ;
+ int mClassItems ;
+
+ boolean mDone ;
+ boolean mRunSampler ;
+ boolean mClassRunSampler ;
+
+ public nsPSMDetector() {
+ initVerifiers( nsPSMDetector.ALL );
+ Reset() ;
+ }
+
+ public nsPSMDetector(int langFlag) {
+ initVerifiers(langFlag);
+ Reset() ;
+ }
+
+ public nsPSMDetector(int aItems, nsVerifier[] aVerifierSet,
+ nsEUCStatistics[] aStatisticsSet) {
+ mClassRunSampler = ( aStatisticsSet != null ) ;
+ mStatisticsData = aStatisticsSet ;
+ mVerifier = aVerifierSet ;
+
+ mClassItems = aItems ;
+ Reset() ;
+ }
+
+
+ public void Reset() {
+ mRunSampler = mClassRunSampler ;
+ mDone = false ;
+ mItems = mClassItems ;
+
+ for(int i=0; i<mItems; i++) {
+ mState[i] = 0;
+ mItemIdx[i] = i;
+ }
+
+ mSampler.Reset() ;
+ }
+
+ protected void initVerifiers(int currVerSet) {
+
+ int idx = 0 ;
+ int currVerifierSet ;
+
+ if (currVerSet >=0 && currVerSet < NO_OF_LANGUAGES ) {
+ currVerifierSet = currVerSet ;
+ }
+ else {
+ currVerifierSet = nsPSMDetector.ALL ;
+ }
+
+ mVerifier = null ;
+ mStatisticsData = null ;
+
+ if ( currVerifierSet == nsPSMDetector.TRADITIONAL_CHINESE ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsBIG5Verifier(),
+ new nsISO2022CNVerifier(),
+ new nsEUCTWVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+
+ mStatisticsData = new nsEUCStatistics[] {
+ null,
+ new Big5Statistics(),
+ null,
+ new EUCTWStatistics(),
+ null,
+ null,
+ null
+ };
+ }
+
+ //==========================================================
+ else if ( currVerifierSet == nsPSMDetector.KOREAN ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsEUCKRVerifier(),
+ new nsISO2022KRVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+ }
+
+ //==========================================================
+ else if ( currVerifierSet == nsPSMDetector.SIMPLIFIED_CHINESE ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsGB2312Verifier(),
+ new nsGB18030Verifier(),
+ new nsISO2022CNVerifier(),
+ new nsHZVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+ }
+
+ //==========================================================
+ else if ( currVerifierSet == nsPSMDetector.JAPANESE ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsSJISVerifier(),
+ new nsEUCJPVerifier(),
+ new nsISO2022JPVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+ }
+ //==========================================================
+ else if ( currVerifierSet == nsPSMDetector.CHINESE ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsGB2312Verifier(),
+ new nsGB18030Verifier(),
+ new nsBIG5Verifier(),
+ new nsISO2022CNVerifier(),
+ new nsHZVerifier(),
+ new nsEUCTWVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+
+ mStatisticsData = new nsEUCStatistics[] {
+ null,
+ new GB2312Statistics(),
+ null,
+ new Big5Statistics(),
+ null,
+ null,
+ new EUCTWStatistics(),
+ null,
+ null,
+ null
+ };
+ }
+
+ //==========================================================
+ else if ( currVerifierSet == nsPSMDetector.ALL ) {
+
+ mVerifier = new nsVerifier[] {
+ new nsUTF8Verifier(),
+ new nsSJISVerifier(),
+ new nsEUCJPVerifier(),
+ new nsISO2022JPVerifier(),
+ new nsEUCKRVerifier(),
+ new nsISO2022KRVerifier(),
+ new nsBIG5Verifier(),
+ new nsEUCTWVerifier(),
+ new nsGB2312Verifier(),
+ new nsGB18030Verifier(),
+ new nsISO2022CNVerifier(),
+ new nsHZVerifier(),
+ new nsCP1252Verifier(),
+ new nsUCS2BEVerifier(),
+ new nsUCS2LEVerifier()
+ };
+
+ mStatisticsData = new nsEUCStatistics[] {
+ null,
+ null,
+ new EUCJPStatistics(),
+ null,
+ new EUCKRStatistics(),
+ null,
+ new Big5Statistics(),
+ new EUCTWStatistics(),
+ new GB2312Statistics(),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null
+ };
+ }
+
+ mClassRunSampler = ( mStatisticsData != null ) ;
+ mClassItems = mVerifier.length ;
+
+ }
+
+ public abstract void Report(String charset) ;
+
+ public boolean HandleData(byte[] aBuf, int len) {
+
+
+ int i,j;
+ byte b, st;
+
+ for( i=0; i < len; i++) {
+ b = aBuf[i] ;
+
+ for (j=0; j < mItems; )
+ {
+ st = nsVerifier.getNextState( mVerifier[mItemIdx[j]],
+ b, mState[j]) ;
+//if (st != 0)
+//System.out.println( "state(0x" + Integer.toHexString(0xFF&b) +") =>"+ Integer.toHexString(st&0xFF)+ " " + mVerifier[mItemIdx[j]].charset());
+
+ if (st == nsVerifier.eItsMe) {
+
+//System.out.println( "eItsMe(0x" + Integer.toHexString(0xFF&b) +") =>"+ mVerifier[mItemIdx[j]].charset());
+
+ Report( mVerifier[mItemIdx[j]].charset() );
+ mDone = true ;
+ return mDone ;
+
+ } else if (st == nsVerifier.eError ) {
+
+//System.out.println( "eNotMe(0x" + Integer.toHexString(0xFF&b) +") =>"+ mVerifier[mItemIdx[j]].charset());
+ mItems--;
+ if (j < mItems ) {
+ mItemIdx[j] = mItemIdx[mItems];
+ mState[j] = mState[mItems];
+ }
+
+ } else {
+
+ mState[j++] = st ;
+
+ }
+ }
+
+ if ( mItems <= 1 ) {
+
+ if( 1 == mItems) {
+ Report( mVerifier[mItemIdx[0]].charset() );
+ }
+ mDone = true ;
+ return mDone ;
+
+ }
+ else {
+
+ int nonUCS2Num=0;
+ int nonUCS2Idx=0;
+
+ for(j=0; j<mItems; j++) {
+ if ( (!(mVerifier[mItemIdx[j]].isUCS2())) &&
+ (!(mVerifier[mItemIdx[j]].isUCS2())) )
+ {
+ nonUCS2Num++ ;
+ nonUCS2Idx = j ;
+ }
+ }
+
+ if (1 == nonUCS2Num) {
+ Report( mVerifier[mItemIdx[nonUCS2Idx]].charset() );
+ mDone = true ;
+ return mDone ;
+ }
+ }
+
+
+ } // End of for( i=0; i < len ...
+
+ if (mRunSampler)
+ Sample(aBuf, len);
+
+ return mDone ;
+ }
+
+
+ public void DataEnd() {
+
+ if (mDone == true)
+ return ;
+
+ if (mItems == 2) {
+ if ((mVerifier[mItemIdx[0]].charset()).equals("GB18030")) {
+ Report(mVerifier[mItemIdx[1]].charset()) ;
+ mDone = true ;
+ } else if ((mVerifier[mItemIdx[1]].charset()).equals("GB18030")) {
+ Report(mVerifier[mItemIdx[0]].charset()) ;
+ mDone = true ;
+ }
+ }
+
+ if (mRunSampler)
+ Sample(null, 0, true);
+ }
+
+ public void Sample(byte[] aBuf, int aLen) {
+ Sample(aBuf, aLen, false) ;
+ }
+
+ public void Sample(byte[] aBuf, int aLen, boolean aLastChance)
+ {
+ int possibleCandidateNum = 0;
+ int j;
+ int eucNum=0 ;
+
+ for (j=0; j< mItems; j++) {
+ if (null != mStatisticsData[mItemIdx[j]])
+ eucNum++ ;
+ if ((!mVerifier[mItemIdx[j]].isUCS2()) &&
+ (!(mVerifier[mItemIdx[j]].charset()).equals("GB18030")))
+ possibleCandidateNum++ ;
+ }
+
+ mRunSampler = (eucNum > 1) ;
+
+ if (mRunSampler) {
+ mRunSampler = mSampler.Sample(aBuf, aLen);
+ if(((aLastChance && mSampler.GetSomeData()) ||
+ mSampler.EnoughData())
+ && (eucNum == possibleCandidateNum)) {
+ mSampler.CalFreq();
+
+ int bestIdx = -1;
+ int eucCnt=0;
+ float bestScore = 0.0f;
+ for(j = 0; j < mItems; j++) {
+ if((null != mStatisticsData[mItemIdx[j]]) &&
+ (!(mVerifier[mItemIdx[j]].charset()).equals("Big5")))
+ {
+ float score = mSampler.GetScore(
+ mStatisticsData[mItemIdx[j]].mFirstByteFreq(),
+ mStatisticsData[mItemIdx[j]].mFirstByteWeight(),
+ mStatisticsData[mItemIdx[j]].mSecondByteFreq(),
+ mStatisticsData[mItemIdx[j]].mSecondByteWeight() );
+//System.out.println("FequencyScore("+mVerifier[mItemIdx[j]].charset()+")= "+ score);
+ if(( 0 == eucCnt++) || (bestScore > score )) {
+ bestScore = score;
+ bestIdx = j;
+ } // if(( 0 == eucCnt++) || (bestScore > score ))
+ } // if(null != ...)
+ } // for
+ if (bestIdx >= 0)
+ {
+ Report( mVerifier[mItemIdx[bestIdx]].charset());
+ mDone = true;
+ }
+ } // if (eucNum == possibleCandidateNum)
+ } // if(mRunSampler)
+ }
+
+ public String[] getProbableCharsets() {
+
+ if (mItems <= 0) {
+ String[] nomatch = new String[1];
+ nomatch[0] = "nomatch" ;
+ return nomatch ;
+ }
+
+ String ret[] = new String[mItems] ;
+ for (int i=0; i<mItems; i++)
+ ret[i] = mVerifier[mItemIdx[i]].charset() ;
+ return ret ;
+ }
+
+}
diff --git a/src/nsSJISVerifier.java b/src/nsSJISVerifier.java
new file mode 100644
index 0000000..5392de0
--- /dev/null
+++ b/src/nsSJISVerifier.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsSJISVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsSJISVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (0))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (4))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 2) << 4) | (2))) ) << 8) | (((int)(((2) << 4) | ( 2))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (3))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+
+
+
+ states = new int[3] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 3) << 4) | (eStart))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+
+
+
+ charset = "Shift_JIS";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsUCS2BEVerifier.java b/src/nsUCS2BEVerifier.java
new file mode 100644
index 0000000..faefad8
--- /dev/null
+++ b/src/nsUCS2BEVerifier.java
@@ -0,0 +1,115 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsUCS2BEVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsUCS2BEVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (4))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+
+
+
+ states = new int[7] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 3) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 7))) ) << 8) | ( ((int)((( 7) << 4) | ( 5))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)(((eItsMe) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 7))) ) << 8) | (((int)((( 7) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)((( 6) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 8) << 4) | ( 5))) )))))) ;
+ states[6] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ;
+
+
+
+ charset = "UTF-16BE";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return true; } ;
+
+
+}
diff --git a/src/nsUCS2LEVerifier.java b/src/nsUCS2LEVerifier.java
new file mode 100644
index 0000000..37ebac7
--- /dev/null
+++ b/src/nsUCS2LEVerifier.java
@@ -0,0 +1,115 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsUCS2LEVerifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsUCS2LEVerifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((2) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((3) << 4) | (3))) ) << 8) | ( ((int)(((3) << 4) | (0))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 5) << 4) | (4))) ) << 8) | (((int)(((0) << 4) | ( 0))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (0))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+
+
+
+ states = new int[7] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 3) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)((( 6) << 4) | ( 7))) ) << 8) | ( ((int)((( 6) << 4) | ( 6))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eItsMe))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( 6) << 4) | ( 6))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eError) << 4) | ( 5))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 8) << 4) | ( 8))) ) << 8) | ( ((int)((( 6) << 4) | ( 7))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ;
+ states[6] = ((int)((( ((int)((( ((int)((( eStart) << 4) | (eStart))) ) << 8) | (((int)(((eError) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | ( 5))) ) << 8) | ( ((int)((( 5) << 4) | ( 5))) )))))) ;
+
+
+
+ charset = "UTF-16LE";
+ stFactor = 6;
+
+ }
+
+ public boolean isUCS2() { return true; } ;
+
+
+}
diff --git a/src/nsUTF8Verifier.java b/src/nsUTF8Verifier.java
new file mode 100644
index 0000000..92d0bec
--- /dev/null
+++ b/src/nsUTF8Verifier.java
@@ -0,0 +1,134 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * DO NOT EDIT THIS DOCUMENT MANUALLY !!!
+ * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER
+ * AutoDetect/tools/
+ */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public class nsUTF8Verifier extends nsVerifier {
+
+ static int[] cclass ;
+ static int[] states ;
+ static int stFactor ;
+ static String charset ;
+
+ public int[] cclass() { return cclass ; }
+ public int[] states() { return states ; }
+ public int stFactor() { return stFactor ; }
+ public String charset() { return charset ; }
+
+ public nsUTF8Verifier() {
+
+ cclass = new int[256/8] ;
+
+ cclass[0] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[1] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[2] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[3] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((0) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[4] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[5] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[6] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[7] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[8] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[9] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[10] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[11] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[12] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[13] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[14] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[15] = ((int)((( ((int)((( ((int)((( 1) << 4) | (1))) ) << 8) | (((int)(((1) << 4) | ( 1))) ))) ) << 16) | ( ((int)((( ((int)(((1) << 4) | (1))) ) << 8) | ( ((int)(((1) << 4) | (1))) )))))) ;
+ cclass[16] = ((int)((( ((int)((( ((int)((( 3) << 4) | (3))) ) << 8) | (((int)(((3) << 4) | ( 3))) ))) ) << 16) | ( ((int)((( ((int)(((2) << 4) | (2))) ) << 8) | ( ((int)(((2) << 4) | (2))) )))))) ;
+ cclass[17] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[18] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[19] = ((int)((( ((int)((( ((int)((( 4) << 4) | (4))) ) << 8) | (((int)(((4) << 4) | ( 4))) ))) ) << 16) | ( ((int)((( ((int)(((4) << 4) | (4))) ) << 8) | ( ((int)(((4) << 4) | (4))) )))))) ;
+ cclass[20] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[21] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[22] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[23] = ((int)((( ((int)((( ((int)((( 5) << 4) | (5))) ) << 8) | (((int)(((5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)(((5) << 4) | (5))) ) << 8) | ( ((int)(((5) << 4) | (5))) )))))) ;
+ cclass[24] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((0) << 4) | (0))) )))))) ;
+ cclass[25] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[26] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[27] = ((int)((( ((int)((( ((int)((( 6) << 4) | (6))) ) << 8) | (((int)(((6) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)(((6) << 4) | (6))) ) << 8) | ( ((int)(((6) << 4) | (6))) )))))) ;
+ cclass[28] = ((int)((( ((int)((( ((int)((( 8) << 4) | (8))) ) << 8) | (((int)(((8) << 4) | ( 8))) ))) ) << 16) | ( ((int)((( ((int)(((8) << 4) | (8))) ) << 8) | ( ((int)(((8) << 4) | (7))) )))))) ;
+ cclass[29] = ((int)((( ((int)((( ((int)((( 8) << 4) | (8))) ) << 8) | (((int)(((9) << 4) | ( 8))) ))) ) << 16) | ( ((int)((( ((int)(((8) << 4) | (8))) ) << 8) | ( ((int)(((8) << 4) | (8))) )))))) ;
+ cclass[30] = ((int)((( ((int)((( ((int)((( 11) << 4) | (11))) ) << 8) | (((int)(((11) << 4) | ( 11))) ))) ) << 16) | ( ((int)((( ((int)(((11) << 4) | (11))) ) << 8) | ( ((int)(((11) << 4) | (10))) )))))) ;
+ cclass[31] = ((int)((( ((int)((( ((int)((( 0) << 4) | (0))) ) << 8) | (((int)(((15) << 4) | ( 14))) ))) ) << 16) | ( ((int)((( ((int)(((13) << 4) | (13))) ) << 8) | ( ((int)(((13) << 4) | (12))) )))))) ;
+
+
+
+ states = new int[26] ;
+
+ states[0] = ((int)((( ((int)((( ((int)((( 10) << 4) | ( 12))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eStart) << 4) | (eError))) )))))) ;
+ states[1] = ((int)((( ((int)((( ((int)((( 3) << 4) | ( 4))) ) << 8) | (((int)((( 5) << 4) | ( 6))) ))) ) << 16) | ( ((int)((( ((int)((( 7) << 4) | ( 8))) ) << 8) | ( ((int)((( 11) << 4) | ( 9))) )))))) ;
+ states[2] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[3] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[4] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[5] = ((int)((( ((int)((( ((int)((( eItsMe) << 4) | (eItsMe))) ) << 8) | (((int)(((eItsMe) << 4) | ( eItsMe))) ))) ) << 16) | ( ((int)((( ((int)(((eItsMe) << 4) | (eItsMe))) ) << 8) | ( ((int)(((eItsMe) << 4) | (eItsMe))) )))))) ;
+ states[6] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | ( 5))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[7] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[8] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 5) << 4) | ( 5))) ))) ) << 16) | ( ((int)((( ((int)((( 5) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[9] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[10] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 7) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)((( 7) << 4) | ( 7))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[11] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[12] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 7) << 4) | ( 7))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[13] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[14] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 9) << 4) | ( 9))) ))) ) << 16) | ( ((int)((( ((int)((( 9) << 4) | ( 9))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[15] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[16] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 9) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[17] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[18] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 12) << 4) | ( 12))) ))) ) << 16) | ( ((int)((( ((int)((( 12) << 4) | ( 12))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[19] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[20] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)((( 12) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[21] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[22] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( 12))) ))) ) << 16) | ( ((int)((( ((int)((( 12) << 4) | ( 12))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[23] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[24] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eStart) << 4) | ( eStart))) ))) ) << 16) | ( ((int)((( ((int)(((eStart) << 4) | (eStart))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+ states[25] = ((int)((( ((int)((( ((int)((( eError) << 4) | (eError))) ) << 8) | (((int)(((eError) << 4) | ( eError))) ))) ) << 16) | ( ((int)((( ((int)(((eError) << 4) | (eError))) ) << 8) | ( ((int)(((eError) << 4) | (eError))) )))))) ;
+
+
+
+ charset = "UTF-8";
+ stFactor = 16;
+
+ }
+
+ public boolean isUCS2() { return false; } ;
+
+
+}
diff --git a/src/nsVerifier.java b/src/nsVerifier.java
new file mode 100644
index 0000000..bd1a5d6
--- /dev/null
+++ b/src/nsVerifier.java
@@ -0,0 +1,75 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
*
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+package org.mozilla.intl.chardet ;
+
+import java.lang.*;
+
+public abstract class nsVerifier {
+
+ static final byte eStart = (byte)0;
+ static final byte eError = (byte)1;
+ static final byte eItsMe = (byte)2;
+ static final int eidxSft4bits = 3;
+ static final int eSftMsk4bits = 7;
+ static final int eBitSft4bits = 2;
+ static final int eUnitMsk4bits = 0x0000000F;
+
+ nsVerifier() {
+ }
+
+ public abstract String charset() ;
+ public abstract int stFactor() ;
+ public abstract int[] cclass() ;
+ public abstract int[] states() ;
+
+ public abstract boolean isUCS2() ;
+
+ public static byte getNextState(nsVerifier v, byte b, byte s) {
+
+ return (byte) ( 0xFF &
+ (((v.states()[((
+ (s*v.stFactor()+(((v.cclass()[((b&0xFF)>>v.eidxSft4bits)])
+ >> ((b & v.eSftMsk4bits) << v.eBitSft4bits))
+ & v.eUnitMsk4bits ))&0xFF)
+ >> v.eidxSft4bits) ]) >> (((
+ (s*v.stFactor()+(((v.cclass()[((b&0xFF)>>v.eidxSft4bits)])
+ >> ((b & v.eSftMsk4bits) << v.eBitSft4bits))
+ & v.eUnitMsk4bits ))&0xFF)
+ & v.eSftMsk4bits) << v.eBitSft4bits)) & v.eUnitMsk4bits )
+ ) ;
+
+ }
+
+
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jchardet.git
More information about the pkg-java-commits
mailing list