From 99e1d150d6ac0d3728fd50be2b688c639e08b659 Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Fri, 25 Jun 1999 07:42:09 +0000 Subject: [PATCH] add new verifier --- intl/chardet/src/nsBIG5Verifier.h | 86 ++++++++++++++++++++++++ intl/chardet/src/nsEUCKRVerifier.h | 85 ++++++++++++++++++++++++ intl/chardet/src/nsEUCTWVerifier.h | 89 +++++++++++++++++++++++++ intl/chardet/src/nsGB2312Verifier.h | 85 ++++++++++++++++++++++++ intl/chardet/src/nsHZVerifier.h | 0 intl/chardet/src/nsISO2022CNVerifier.h | 0 intl/chardet/src/nsISO2022KRVerifier.h | 0 intl/chardet/src/nsUCS2BEVerifier.h | 92 ++++++++++++++++++++++++++ intl/chardet/src/nsUCS2LEVerifier.h | 92 ++++++++++++++++++++++++++ 9 files changed, 529 insertions(+) create mode 100644 intl/chardet/src/nsBIG5Verifier.h create mode 100644 intl/chardet/src/nsEUCKRVerifier.h create mode 100644 intl/chardet/src/nsEUCTWVerifier.h create mode 100644 intl/chardet/src/nsGB2312Verifier.h create mode 100644 intl/chardet/src/nsHZVerifier.h create mode 100644 intl/chardet/src/nsISO2022CNVerifier.h create mode 100644 intl/chardet/src/nsISO2022KRVerifier.h create mode 100644 intl/chardet/src/nsUCS2BEVerifier.h create mode 100644 intl/chardet/src/nsUCS2LEVerifier.h diff --git a/intl/chardet/src/nsBIG5Verifier.h b/intl/chardet/src/nsBIG5Verifier.h new file mode 100644 index 00000000000..e258d92603d --- /dev/null +++ b/intl/chardet/src/nsBIG5Verifier.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 BIG5_cls [ 256 / 8 ] = { +PCK4BITS(0,1,1,1,1,1,1,1), // 00 - 07 +PCK4BITS(1,1,1,1,1,1,1,1), // 08 - 0f +PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17 +PCK4BITS(1,1,1,0,1,1,1,1), // 18 - 1f +PCK4BITS(1,1,1,1,1,1,1,1), // 20 - 27 +PCK4BITS(1,1,1,1,1,1,1,1), // 28 - 2f +PCK4BITS(1,1,1,1,1,1,1,1), // 30 - 37 +PCK4BITS(1,1,1,1,1,1,1,1), // 38 - 3f +PCK4BITS(2,2,2,2,2,2,2,2), // 40 - 47 +PCK4BITS(2,2,2,2,2,2,2,2), // 48 - 4f +PCK4BITS(2,2,2,2,2,2,2,2), // 50 - 57 +PCK4BITS(2,2,2,2,2,2,2,2), // 58 - 5f +PCK4BITS(2,2,2,2,2,2,2,2), // 60 - 67 +PCK4BITS(2,2,2,2,2,2,2,2), // 68 - 6f +PCK4BITS(2,2,2,2,2,2,2,2), // 70 - 77 +PCK4BITS(2,2,2,2,2,2,2,1), // 78 - 7f +PCK4BITS(4,4,4,4,4,4,4,4), // 80 - 87 +PCK4BITS(4,4,4,4,4,4,4,4), // 88 - 8f +PCK4BITS(4,4,4,4,4,4,4,4), // 90 - 97 +PCK4BITS(4,4,4,4,4,4,4,4), // 98 - 9f +PCK4BITS(4,3,3,3,3,3,3,3), // a0 - a7 +PCK4BITS(3,3,3,3,3,3,3,3), // a8 - af +PCK4BITS(3,3,3,3,3,3,3,3), // b0 - b7 +PCK4BITS(3,3,3,3,3,3,3,3), // b8 - bf +PCK4BITS(3,3,3,3,3,3,3,3), // c0 - c7 +PCK4BITS(3,3,3,3,3,3,3,3), // c8 - cf +PCK4BITS(3,3,3,3,3,3,3,3), // d0 - d7 +PCK4BITS(3,3,3,3,3,3,3,3), // d8 - df +PCK4BITS(3,3,3,3,3,3,3,3), // e0 - e7 +PCK4BITS(3,3,3,3,3,3,3,3), // e8 - ef +PCK4BITS(3,3,3,3,3,3,3,3), // f0 - f7 +PCK4BITS(3,3,3,3,3,3,3,0) // f8 - ff +}; + + +static PRUint32 BIG5_st [ 3] = { +PCK4BITS(eError,eStart,eStart, 3,eError,eError,eError,eError),//00-07 +PCK4BITS(eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError),//08-0f +PCK4BITS(eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart) //10-17 +}; + + +static nsVerifier nsBIG5Verifier = { + "BIG5", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + BIG5_cls + }, + 5, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + BIG5_st + } +}; diff --git a/intl/chardet/src/nsEUCKRVerifier.h b/intl/chardet/src/nsEUCKRVerifier.h new file mode 100644 index 00000000000..a0fd9ce4e35 --- /dev/null +++ b/intl/chardet/src/nsEUCKRVerifier.h @@ -0,0 +1,85 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 EUCKR_cls [ 256 / 8 ] = { +PCK4BITS(0,1,1,1,1,1,1,1), // 00 - 07 +PCK4BITS(1,1,1,1,1,1,1,1), // 08 - 0f +PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17 +PCK4BITS(1,1,1,0,1,1,1,1), // 18 - 1f +PCK4BITS(1,1,1,1,1,1,1,1), // 20 - 27 +PCK4BITS(1,1,1,1,1,1,1,1), // 28 - 2f +PCK4BITS(1,1,1,1,1,1,1,1), // 30 - 37 +PCK4BITS(1,1,1,1,1,1,1,1), // 38 - 3f +PCK4BITS(1,1,1,1,1,1,1,1), // 40 - 47 +PCK4BITS(1,1,1,1,1,1,1,1), // 48 - 4f +PCK4BITS(1,1,1,1,1,1,1,1), // 50 - 57 +PCK4BITS(1,1,1,1,1,1,1,1), // 58 - 5f +PCK4BITS(1,1,1,1,1,1,1,1), // 60 - 67 +PCK4BITS(1,1,1,1,1,1,1,1), // 68 - 6f +PCK4BITS(1,1,1,1,1,1,1,1), // 70 - 77 +PCK4BITS(1,1,1,1,1,1,1,1), // 78 - 7f +PCK4BITS(0,0,0,0,0,0,0,0), // 80 - 87 +PCK4BITS(0,0,0,0,0,0,0,0), // 88 - 8f +PCK4BITS(0,0,0,0,0,0,0,0), // 90 - 97 +PCK4BITS(0,0,0,0,0,0,0,0), // 98 - 9f +PCK4BITS(0,2,2,2,2,2,2,2), // a0 - a7 +PCK4BITS(2,2,2,2,2,3,3,3), // a8 - af +PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7 +PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf +PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7 +PCK4BITS(2,3,2,2,2,2,2,2), // c8 - cf +PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7 +PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df +PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7 +PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef +PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7 +PCK4BITS(2,2,2,2,2,2,2,0) // f8 - ff +}; + + +static PRUint32 EUCKR_st [ 2] = { +PCK4BITS(eError,eStart, 3,eError,eError,eError,eError,eError),//00-07 +PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f +}; + + +static nsVerifier nsEUCKRVerifier = { + "EUC-KR", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + EUCKR_cls + }, + 4, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + EUCKR_st + } +}; diff --git a/intl/chardet/src/nsEUCTWVerifier.h b/intl/chardet/src/nsEUCTWVerifier.h new file mode 100644 index 00000000000..4ca5a5cac88 --- /dev/null +++ b/intl/chardet/src/nsEUCTWVerifier.h @@ -0,0 +1,89 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 EUCTW_cls [ 256 / 8 ] = { +PCK4BITS(0,2,2,2,2,2,2,2), // 00 - 07 +PCK4BITS(2,2,2,2,2,2,2,2), // 08 - 0f +PCK4BITS(2,2,2,2,2,2,2,2), // 10 - 17 +PCK4BITS(2,2,2,0,2,2,2,2), // 18 - 1f +PCK4BITS(2,2,2,2,2,2,2,2), // 20 - 27 +PCK4BITS(2,2,2,2,2,2,2,2), // 28 - 2f +PCK4BITS(2,2,2,2,2,2,2,2), // 30 - 37 +PCK4BITS(2,2,2,2,2,2,2,2), // 38 - 3f +PCK4BITS(2,2,2,2,2,2,2,2), // 40 - 47 +PCK4BITS(2,2,2,2,2,2,2,2), // 48 - 4f +PCK4BITS(2,2,2,2,2,2,2,2), // 50 - 57 +PCK4BITS(2,2,2,2,2,2,2,2), // 58 - 5f +PCK4BITS(2,2,2,2,2,2,2,2), // 60 - 67 +PCK4BITS(2,2,2,2,2,2,2,2), // 68 - 6f +PCK4BITS(2,2,2,2,2,2,2,2), // 70 - 77 +PCK4BITS(2,2,2,2,2,2,2,2), // 78 - 7f +PCK4BITS(0,0,0,0,0,0,0,0), // 80 - 87 +PCK4BITS(0,0,0,0,0,0,6,0), // 88 - 8f +PCK4BITS(0,0,0,0,0,0,0,0), // 90 - 97 +PCK4BITS(0,0,0,0,0,0,0,0), // 98 - 9f +PCK4BITS(0,3,4,4,4,4,4,4), // a0 - a7 +PCK4BITS(5,5,1,1,1,1,1,1), // a8 - af +PCK4BITS(1,1,1,1,1,1,1,1), // b0 - b7 +PCK4BITS(1,1,1,1,1,1,1,1), // b8 - bf +PCK4BITS(1,1,3,1,3,3,3,3), // c0 - c7 +PCK4BITS(3,3,3,3,3,3,3,3), // c8 - cf +PCK4BITS(3,3,3,3,3,3,3,3), // d0 - d7 +PCK4BITS(3,3,3,3,3,3,3,3), // d8 - df +PCK4BITS(3,3,3,3,3,3,3,3), // e0 - e7 +PCK4BITS(3,3,3,3,3,3,3,3), // e8 - ef +PCK4BITS(3,3,3,3,3,3,3,3), // f0 - f7 +PCK4BITS(3,3,3,3,3,3,3,0) // f8 - ff +}; + + +static PRUint32 EUCTW_st [ 6] = { +PCK4BITS(eError,eError,eStart, 3, 3, 3, 4,eError),//00-07 +PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//08-0f +PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError),//10-17 +PCK4BITS(eStart,eStart,eStart,eError,eError,eError,eError,eError),//18-1f +PCK4BITS( 5,eError,eError,eError,eStart,eError,eStart,eStart),//20-27 +PCK4BITS(eStart,eError,eStart,eStart,eStart,eStart,eStart,eStart) //28-2f +}; + + +static nsVerifier nsEUCTWVerifier = { + "x-euc-tw", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + EUCTW_cls + }, + 7, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + EUCTW_st + } +}; diff --git a/intl/chardet/src/nsGB2312Verifier.h b/intl/chardet/src/nsGB2312Verifier.h new file mode 100644 index 00000000000..8bd4f255348 --- /dev/null +++ b/intl/chardet/src/nsGB2312Verifier.h @@ -0,0 +1,85 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 GB2312_cls [ 256 / 8 ] = { +PCK4BITS(0,1,1,1,1,1,1,1), // 00 - 07 +PCK4BITS(1,1,1,1,1,1,1,1), // 08 - 0f +PCK4BITS(1,1,1,1,1,1,1,1), // 10 - 17 +PCK4BITS(1,1,1,0,1,1,1,1), // 18 - 1f +PCK4BITS(1,1,1,1,1,1,1,1), // 20 - 27 +PCK4BITS(1,1,1,1,1,1,1,1), // 28 - 2f +PCK4BITS(1,1,1,1,1,1,1,1), // 30 - 37 +PCK4BITS(1,1,1,1,1,1,1,1), // 38 - 3f +PCK4BITS(1,1,1,1,1,1,1,1), // 40 - 47 +PCK4BITS(1,1,1,1,1,1,1,1), // 48 - 4f +PCK4BITS(1,1,1,1,1,1,1,1), // 50 - 57 +PCK4BITS(1,1,1,1,1,1,1,1), // 58 - 5f +PCK4BITS(1,1,1,1,1,1,1,1), // 60 - 67 +PCK4BITS(1,1,1,1,1,1,1,1), // 68 - 6f +PCK4BITS(1,1,1,1,1,1,1,1), // 70 - 77 +PCK4BITS(1,1,1,1,1,1,1,1), // 78 - 7f +PCK4BITS(0,0,0,0,0,0,0,0), // 80 - 87 +PCK4BITS(0,0,0,0,0,0,0,0), // 88 - 8f +PCK4BITS(0,0,0,0,0,0,0,0), // 90 - 97 +PCK4BITS(0,0,0,0,0,0,0,0), // 98 - 9f +PCK4BITS(0,2,2,2,2,2,2,2), // a0 - a7 +PCK4BITS(2,2,3,3,3,3,3,3), // a8 - af +PCK4BITS(2,2,2,2,2,2,2,2), // b0 - b7 +PCK4BITS(2,2,2,2,2,2,2,2), // b8 - bf +PCK4BITS(2,2,2,2,2,2,2,2), // c0 - c7 +PCK4BITS(2,2,2,2,2,2,2,2), // c8 - cf +PCK4BITS(2,2,2,2,2,2,2,2), // d0 - d7 +PCK4BITS(2,2,2,2,2,2,2,2), // d8 - df +PCK4BITS(2,2,2,2,2,2,2,2), // e0 - e7 +PCK4BITS(2,2,2,2,2,2,2,2), // e8 - ef +PCK4BITS(2,2,2,2,2,2,2,2), // f0 - f7 +PCK4BITS(2,2,2,2,2,2,2,0) // f8 - ff +}; + + +static PRUint32 GB2312_st [ 2] = { +PCK4BITS(eError,eStart, 3,eError,eError,eError,eError,eError),//00-07 +PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart) //08-0f +}; + + +static nsVerifier nsGB2312Verifier = { + "GB2312", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + GB2312_cls + }, + 4, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + GB2312_st + } +}; diff --git a/intl/chardet/src/nsHZVerifier.h b/intl/chardet/src/nsHZVerifier.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/intl/chardet/src/nsISO2022CNVerifier.h b/intl/chardet/src/nsISO2022CNVerifier.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/intl/chardet/src/nsISO2022KRVerifier.h b/intl/chardet/src/nsISO2022KRVerifier.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/intl/chardet/src/nsUCS2BEVerifier.h b/intl/chardet/src/nsUCS2BEVerifier.h new file mode 100644 index 00000000000..967b1bd8ec1 --- /dev/null +++ b/intl/chardet/src/nsUCS2BEVerifier.h @@ -0,0 +1,92 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 UCSBE_cls [ 256 / 8 ] = { +PCK4BITS(1,7,7,7,7,7,7,7), // 00 - 07 +PCK4BITS(7,7,4,7,7,3,7,7), // 08 - 0f +PCK4BITS(7,7,7,7,7,7,7,7), // 10 - 17 +PCK4BITS(7,7,7,7,7,7,7,7), // 18 - 1f +PCK4BITS(7,7,7,7,7,7,7,7), // 20 - 27 +PCK4BITS(0,0,0,0,0,0,0,0), // 28 - 2f +PCK4BITS(7,7,7,7,0,0,0,0), // 30 - 37 +PCK4BITS(0,0,7,7,7,7,7,7), // 38 - 3f +PCK4BITS(7,0,0,0,0,0,0,0), // 40 - 47 +PCK4BITS(0,0,0,0,0,0,7,7), // 48 - 4f +PCK4BITS(7,7,7,7,7,7,7,7), // 50 - 57 +PCK4BITS(7,7,7,7,7,7,7,7), // 58 - 5f +PCK4BITS(7,7,7,7,7,7,7,7), // 60 - 67 +PCK4BITS(7,7,7,7,7,7,7,7), // 68 - 6f +PCK4BITS(7,7,7,7,7,7,7,7), // 70 - 77 +PCK4BITS(7,7,7,7,7,7,7,7), // 78 - 7f +PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87 +PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f +PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97 +PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f +PCK4BITS(7,7,7,7,7,7,7,7), // a0 - a7 +PCK4BITS(7,7,7,7,7,7,7,7), // a8 - af +PCK4BITS(7,7,7,7,7,7,7,7), // b0 - b7 +PCK4BITS(7,7,7,7,7,7,7,7), // b8 - bf +PCK4BITS(7,7,7,7,7,7,7,7), // c0 - c7 +PCK4BITS(7,7,7,7,7,7,7,7), // c8 - cf +PCK4BITS(7,7,7,7,7,7,7,7), // d0 - d7 +PCK4BITS(7,7,7,7,7,7,7,7), // d8 - df +PCK4BITS(7,7,7,7,7,7,7,7), // e0 - e7 +PCK4BITS(7,7,7,7,7,7,7,7), // e8 - ef +PCK4BITS(7,7,7,7,7,7,7,7), // f0 - f7 +PCK4BITS(7,7,7,7,7,7,5,6) // f8 - ff +}; + + +static PRUint32 UCSBE_st [ 9] = { +PCK4BITS(eError, 5, 3, 6, 6, 7, 8, 3),//00-07 +PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//08-0f +PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17 +PCK4BITS( 4, 4, 4, 4, 4, 4, 4, 4),//18-1f +PCK4BITS(eError, 5, 3, 6, 6, 3, 3, 3),//20-27 +PCK4BITS( 4, 4,eError, 4, 4, 4, 4, 4),//28-2f +PCK4BITS( 4, 4, 4,eError, 4, 4, 4, 4),//30-37 +PCK4BITS( 4, 4, 4, 4, 4, 4,eItsMe, 4),//38-3f +PCK4BITS( 4, 4, 4, 4, 4,eError, 4, 4) //40-47 +}; + + +static nsVerifier nsUCSBEVerifier = { + "ISO-10646-UCS-2-BE", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + UCSBE_cls + }, + 8, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + UCSBE_st + } +}; diff --git a/intl/chardet/src/nsUCS2LEVerifier.h b/intl/chardet/src/nsUCS2LEVerifier.h new file mode 100644 index 00000000000..4c8d07988ad --- /dev/null +++ b/intl/chardet/src/nsUCS2LEVerifier.h @@ -0,0 +1,92 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ +/* + * DO NOT EDIT THIS DOCUMENT MANUALLY !!! + * THIS FILE IS AUTOMATICALLY GENERATED BY THE TOOLS UNDER + * mozilla/intl/chardet/tools/ + * Please contact ftang@netscape.com or mozilla-i18n@mozilla.org + * if you have any question. Thanks + */ +#include "nsVerifier.h" +static PRUint32 UCSLE_cls [ 256 / 8 ] = { +PCK4BITS(1,7,7,7,7,7,7,7), // 00 - 07 +PCK4BITS(7,7,4,7,7,3,7,7), // 08 - 0f +PCK4BITS(7,7,7,7,7,7,7,7), // 10 - 17 +PCK4BITS(7,7,7,7,7,7,7,7), // 18 - 1f +PCK4BITS(7,7,7,7,7,7,7,7), // 20 - 27 +PCK4BITS(0,0,0,0,0,0,0,0), // 28 - 2f +PCK4BITS(7,7,7,7,0,0,0,0), // 30 - 37 +PCK4BITS(0,0,7,7,7,7,7,7), // 38 - 3f +PCK4BITS(7,0,0,0,0,0,0,0), // 40 - 47 +PCK4BITS(0,0,0,0,0,0,7,7), // 48 - 4f +PCK4BITS(7,7,7,7,7,7,7,7), // 50 - 57 +PCK4BITS(7,7,7,7,7,7,7,7), // 58 - 5f +PCK4BITS(7,7,7,7,7,7,7,7), // 60 - 67 +PCK4BITS(7,7,7,7,7,7,7,7), // 68 - 6f +PCK4BITS(7,7,7,7,7,7,7,7), // 70 - 77 +PCK4BITS(7,7,7,7,7,7,7,7), // 78 - 7f +PCK4BITS(2,2,2,2,2,2,2,2), // 80 - 87 +PCK4BITS(2,2,2,2,2,2,2,2), // 88 - 8f +PCK4BITS(2,2,2,2,2,2,2,2), // 90 - 97 +PCK4BITS(2,2,2,2,2,2,2,2), // 98 - 9f +PCK4BITS(7,7,7,7,7,7,7,7), // a0 - a7 +PCK4BITS(7,7,7,7,7,7,7,7), // a8 - af +PCK4BITS(7,7,7,7,7,7,7,7), // b0 - b7 +PCK4BITS(7,7,7,7,7,7,7,7), // b8 - bf +PCK4BITS(7,7,7,7,7,7,7,7), // c0 - c7 +PCK4BITS(7,7,7,7,7,7,7,7), // c8 - cf +PCK4BITS(7,7,7,7,7,7,7,7), // d0 - d7 +PCK4BITS(7,7,7,7,7,7,7,7), // d8 - df +PCK4BITS(7,7,7,7,7,7,7,7), // e0 - e7 +PCK4BITS(7,7,7,7,7,7,7,7), // e8 - ef +PCK4BITS(7,7,7,7,7,7,7,7), // f0 - f7 +PCK4BITS(7,7,7,7,7,7,5,6) // f8 - ff +}; + + +static PRUint32 UCSLE_st [ 9] = { +PCK4BITS( 3, 3, 5, 6, 3, 8, 7, 3),//00-07 +PCK4BITS(eError,eError,eError,eError,eError,eError,eError,eError),//08-0f +PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe),//10-17 +PCK4BITS(eError, 4, 4, 4, 4, 4, 4, 4),//18-1f +PCK4BITS( 3, 3, 5, 6, 3, 3, 3, 3),//20-27 +PCK4BITS( 4,eError, 4, 4, 4, 4, 4, 4),//28-2f +PCK4BITS( 4, 4, 4,eError,eError, 4, 4, 4),//30-37 +PCK4BITS(eError, 4, 4, 4, 4,eItsMe, 4, 4),//38-3f +PCK4BITS(eError, 4, 4, 4, 4, 4,eError, 4) //40-47 +}; + + +static nsVerifier nsUCSLEVerifier = { + "ISO-10646-UCS-2-LE", + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + UCSLE_cls + }, + 8, + { + eIdxSft4bits, + eSftMsk4bits, + eBitSft4bits, + eUnitMsk4bits, + UCSLE_st + } +};