Accept halfwidth katakana in iso-2022-jp: bug 172393 r=ftang sr=roc

This commit is contained in:
jgmyers%speakeasy.net 2004-01-03 21:45:21 +00:00
parent 3028b31f1a
commit ce5088ba8f
4 changed files with 67 additions and 41 deletions

View File

@ -159,8 +159,8 @@ PCK4BITS(0,0,0,0,7,0,0,0), // 20 - 27
PCK4BITS(3,0,0,0,0,0,0,0), // 28 - 2f
PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
PCK4BITS(6,0,4,0,0,0,0,0), // 40 - 47
PCK4BITS(0,0,5,0,0,0,0,0), // 48 - 4f
PCK4BITS(6,0,4,0,8,0,0,0), // 40 - 47
PCK4BITS(0,9,5,0,0,0,0,0), // 48 - 4f
PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
@ -186,20 +186,23 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
};
static PRUint32 ISO2022JP_st [ 6] = {
static PRUint32 ISO2022JP_st [ 9] = {
PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//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,eError,eError, 5,eError,eError,eError, 4),//18-1f
PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eItsMe,eError),//20-27
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eError,eError) //28-2f
PCK4BITS(eStart,eStart,eError,eError,eError,eError,eError,eError),//08-0f
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError),//18-1f
PCK4BITS(eError, 5,eError,eError,eError, 4,eError,eError),//20-27
PCK4BITS(eError,eError,eError, 6,eItsMe,eError,eItsMe,eError),//28-2f
PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//30-37
PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f
PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47
};
static const PRUint32 ISO2022JPCharLenTable[] = {0, 0, 0, 0, 0, 0, 0, 0};
SMModel ISO2022JPSMModel = {
{eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_cls },
8,
10,
{eIdxSft4bits, eSftMsk4bits, eBitSft4bits, eUnitMsk4bits, ISO2022JP_st },
ISO2022JPCharLenTable,
"ISO-2022-JP",

View File

@ -52,8 +52,8 @@ PCK4BITS(0,0,0,0,7,0,0,0), // 20 - 27
PCK4BITS(3,0,0,0,0,0,0,0), // 28 - 2f
PCK4BITS(0,0,0,0,0,0,0,0), // 30 - 37
PCK4BITS(0,0,0,0,0,0,0,0), // 38 - 3f
PCK4BITS(6,0,4,0,0,0,0,0), // 40 - 47
PCK4BITS(0,0,5,0,0,0,0,0), // 48 - 4f
PCK4BITS(6,0,4,0,8,0,0,0), // 40 - 47
PCK4BITS(0,9,5,0,0,0,0,0), // 48 - 4f
PCK4BITS(0,0,0,0,0,0,0,0), // 50 - 57
PCK4BITS(0,0,0,0,0,0,0,0), // 58 - 5f
PCK4BITS(0,0,0,0,0,0,0,0), // 60 - 67
@ -79,13 +79,16 @@ PCK4BITS(2,2,2,2,2,2,2,2) // f8 - ff
};
static const PRUint32 ISO2022JP_st [ 6] = {
static const PRUint32 ISO2022JP_st [ 9] = {
PCK4BITS(eStart, 3,eError,eStart,eStart,eStart,eStart,eStart),//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,eError,eError, 5,eError,eError,eError, 4),//18-1f
PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eItsMe,eError),//20-27
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eError,eError) //28-2f
PCK4BITS(eStart,eStart,eError,eError,eError,eError,eError,eError),//08-0f
PCK4BITS(eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe),//10-17
PCK4BITS(eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError),//18-1f
PCK4BITS(eError, 5,eError,eError,eError, 4,eError,eError),//20-27
PCK4BITS(eError,eError,eError, 6,eItsMe,eError,eItsMe,eError),//28-2f
PCK4BITS(eError,eError,eError,eError,eError,eError,eItsMe,eItsMe),//30-37
PCK4BITS(eError,eError,eError,eItsMe,eError,eError,eError,eError),//38-3f
PCK4BITS(eError,eError,eError,eError,eItsMe,eError,eStart,eStart) //40-47
};
@ -98,7 +101,7 @@ static nsVerifier nsISO2022JPVerifier = {
eUnitMsk4bits,
ISO2022JP_cls
},
8,
10,
{
eIdxSft4bits,
eSftMsk4bits,

View File

@ -8,6 +8,7 @@ my(@iso2022jp_cls);
my(@iso2022jp_st);
my($iso2022jp_ver);
# 1:ESC 3:'(' 4:'B' 5:'J' 6:'@' 7:'$' 8:'D' 9:'I'
@iso2022jp_cls = (
[ 0x0e , 0x0f , 2 ],
[ 0x28 , 0x28 , 3 ],
@ -15,6 +16,8 @@ my($iso2022jp_ver);
[ 0x4a , 0x4a , 5 ],
[ 0x40 , 0x40 , 6 ],
[ 0x24 , 0x24 , 7 ],
[ 0x44 , 0x44 , 8 ],
[ 0x49 , 0x49 , 9 ],
[ 0x01 , 0x1a , 0 ],
[ 0x1c , 0x7f , 0 ],
[ 0x1b , 0x1b , 1 ],
@ -24,17 +27,18 @@ my($iso2022jp_ver);
package genverifier;
@iso2022jp_st = (
# 0 1 2 3 4 5 6 7
0, 3, 1, 0, 0, 0, 0, 0, # Start State - 0
1, 1, 1, 1, 1, 1, 1, 1, # Error State - 1
2, 2, 2, 2, 2, 2, 2, 2, # ItsMe State - 2
1, 1, 1, 5, 1, 1, 1, 4, # got ESC
1, 1, 1, 1, 2, 1, 2, 1, # got ESC $
1, 1, 1, 1, 2, 2, 1, 1, # got ESC (
# 0 1 2 3 4 5 6 7 8 9
0, 3, 1, 0, 0, 0, 0, 0, 0, 0, # Start State - 0
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # Error State - 1
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # ItsMe State - 2
1, 1, 1, 5, 1, 1, 1, 4, 1, 1, # got ESC
1, 1, 1, 6, 2, 1, 2, 1, 1, 1, # got ESC $
1, 1, 1, 1, 2, 2, 1, 1, 1, 2, # got ESC (
1, 1, 1, 1, 1, 1, 1, 1, 2, 1, # got ESC $ (
);
$iso2022jp_ver = genverifier::GenVerifier("ISO2022JP", "ISO-2022-JP",
\@iso2022jp_cls, 8, \@iso2022jp_st);
\@iso2022jp_cls, 10, \@iso2022jp_st);
print $iso2022jp_ver;

View File

@ -14,27 +14,43 @@ $VERSION = 1.00;
sub GenNPL {
my($ret) = << "END_NPL";
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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.
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
* 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.
*
* Contributor(s):
*/
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
END_NPL
return $ret;