bug 135850 - Make Korean JOHAB encoder (Compatibility Jamo part) aligned with

Adobe CMap and XFree86 font encoding file for JOHAB.
r=yokoyama,sr=alecf,a=asa
This commit is contained in:
jshin%mailaps.org 2002-07-14 10:28:48 +00:00
parent be96945e7e
commit f1e67b79cd
7 changed files with 499 additions and 10 deletions

View File

@ -0,0 +1,93 @@
/* -*- 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) 2001 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*========================================================
This is a Generated file. Please don't edit it.
The tool which used to generate this file is called umaptable.
You can find this tool under mozilla/intl/uconv/tools/umaptable.c.
If you have any problem of this file. Please contact
Netscape Client International Team or
ftang@netscape <Frank Tang>
Note manually added by Jungshik Shin <jshin@mailaps.org>
The table was generated by filtering JOHAB.TXT at
http://jshin.net/faq/JOHAB.TXT.gz
gunzip -c JOHAB.TXT.gz | egrep '^0x.... +0x31(3[1-F]|[45][0-F]|6[0-3])' \
| umaptable -uf
Table in Debug form
Begin of Item 0000
Format 0
srcBegin = 313A
srcEnd = 3140
destBegin = 844A
End of Item 0000
Begin of Item 0001
Format 1
srcBegin = 3131
srcEnd = 3163
mappingOffset = 0000
Mapping =
8841 8C41 8444 9041 8446 8447 9441 9841
9C41 FFFD FFFD FFFD FFFD FFFD FFFD FFFD
A041 A441 A841 8454 AC41 B041 B441 B841
BC41 C041 C441 C841 CC41 D041 8461 8481
84A1 84C1 84E1 8541 8561 8581 85A1 85C1
85E1 8641 8661 8681 86A1 86C1 86E1 8741
8761 8781 87A1
End of Item 0001
========================================================*/
/* Offset=0x0000 ItemOfList */
0x0002,
/*-------------------------------------------------------*/
/* Offset=0x0001 offsetToFormatArray */
0x0004,
/*-------------------------------------------------------*/
/* Offset=0x0002 offsetToMapCellArray */
0x0005,
/*-------------------------------------------------------*/
/* Offset=0x0003 offsetToMappingTable */
0x000B,
/*-------------------------------------------------------*/
/* Offset=0x0004 Start of Format Array */
/* Total of Format 0 : 0x0001 */
/* Total of Format 1 : 0x0001 */
/* Total of Format 2 : 0x0000 */
/* Total of Format 3 : 0x0000 */
0x0010,
/*-------------------------------------------------------*/
/* Offset=0x0005 Start of MapCell Array */
/* 0000 */ 0x313A, 0x3140, 0x844A,
/* 0001 */ 0x3131, 0x3163, 0x0000,
/*-------------------------------------------------------*/
/* Offset=0x000B Start of MappingTable */
/* 0000 */ 0x8841, 0x8C41, 0x8444, 0x9041, 0x8446, 0x8447, 0x9441, 0x9841,
/* 0008 */ 0x9C41, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
/* 0010 */ 0xA041, 0xA441, 0xA841, 0x8454, 0xAC41, 0xB041, 0xB441, 0xB841,
/* 0018 */ 0xBC41, 0xC041, 0xC441, 0xC841, 0xCC41, 0xD041, 0x8461, 0x8481,
/* 0020 */ 0x84A1, 0x84C1, 0x84E1, 0x8541, 0x8561, 0x8581, 0x85A1, 0x85C1,
/* 0028 */ 0x85E1, 0x8641, 0x8661, 0x8681, 0x86A1, 0x86C1, 0x86E1, 0x8741,
/* 0030 */ 0x8761, 0x8781, 0x87A1,
/* End of table Total Length = 0x003E * 2 */

View File

@ -0,0 +1,368 @@
/* -*- 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) 2001 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*========================================================
This is a Generated file. Please don't edit it.
The tool which used to generate this file is called umaptable.
You can find this tool under mozilla/intl/uconv/tools/umaptable.c.
If you have any problem of this file. Please contact
Netscape Client International Team or
ftang@netscape <Frank Tang>
Note manually added by Jungshik Shin <jshin@mailaps.org>
The table was generated by filtering JOHAB.TXT at
http://jshin.net/faq/JOHAB.TXT.gz
gunzip -c JOHAB.TXT.gz | egrep '^0x.... +0x31(3[1-F]|[45][0-F]|6[0-3])' \
| umaptable -ut
Table in Debug form
Begin of Item 0000
Format 0
srcBegin = 844A
srcEnd = 8450
destBegin = 313A
End of Item 0000
Begin of Item 0001
Format 1
srcBegin = 8444
srcEnd = 8447
mappingOffset = 0000
Mapping =
3133 FFFD 3135 3136
End of Item 0001
Begin of Item 0002
Format 2
srcBegin = 8454
destBegin = 3144
End of Item 0002
Begin of Item 0003
Format 2
srcBegin = 8461
destBegin = 314F
End of Item 0003
Begin of Item 0004
Format 2
srcBegin = 8481
destBegin = 3150
End of Item 0004
Begin of Item 0005
Format 2
srcBegin = 84A1
destBegin = 3151
End of Item 0005
Begin of Item 0006
Format 2
srcBegin = 84C1
destBegin = 3152
End of Item 0006
Begin of Item 0007
Format 2
srcBegin = 84E1
destBegin = 3153
End of Item 0007
Begin of Item 0008
Format 2
srcBegin = 8541
destBegin = 3154
End of Item 0008
Begin of Item 0009
Format 2
srcBegin = 8561
destBegin = 3155
End of Item 0009
Begin of Item 000A
Format 2
srcBegin = 8581
destBegin = 3156
End of Item 000A
Begin of Item 000B
Format 2
srcBegin = 85A1
destBegin = 3157
End of Item 000B
Begin of Item 000C
Format 2
srcBegin = 85C1
destBegin = 3158
End of Item 000C
Begin of Item 000D
Format 2
srcBegin = 85E1
destBegin = 3159
End of Item 000D
Begin of Item 000E
Format 2
srcBegin = 8641
destBegin = 315A
End of Item 000E
Begin of Item 000F
Format 2
srcBegin = 8661
destBegin = 315B
End of Item 000F
Begin of Item 0010
Format 2
srcBegin = 8681
destBegin = 315C
End of Item 0010
Begin of Item 0011
Format 2
srcBegin = 86A1
destBegin = 315D
End of Item 0011
Begin of Item 0012
Format 2
srcBegin = 86C1
destBegin = 315E
End of Item 0012
Begin of Item 0013
Format 2
srcBegin = 86E1
destBegin = 315F
End of Item 0013
Begin of Item 0014
Format 2
srcBegin = 8741
destBegin = 3160
End of Item 0014
Begin of Item 0015
Format 2
srcBegin = 8761
destBegin = 3161
End of Item 0015
Begin of Item 0016
Format 2
srcBegin = 8781
destBegin = 3162
End of Item 0016
Begin of Item 0017
Format 2
srcBegin = 87A1
destBegin = 3163
End of Item 0017
Begin of Item 0018
Format 2
srcBegin = 8841
destBegin = 3131
End of Item 0018
Begin of Item 0019
Format 2
srcBegin = 8C41
destBegin = 3132
End of Item 0019
Begin of Item 001A
Format 2
srcBegin = 9041
destBegin = 3134
End of Item 001A
Begin of Item 001B
Format 2
srcBegin = 9441
destBegin = 3137
End of Item 001B
Begin of Item 001C
Format 2
srcBegin = 9841
destBegin = 3138
End of Item 001C
Begin of Item 001D
Format 2
srcBegin = 9C41
destBegin = 3139
End of Item 001D
Begin of Item 001E
Format 2
srcBegin = A041
destBegin = 3141
End of Item 001E
Begin of Item 001F
Format 2
srcBegin = A441
destBegin = 3142
End of Item 001F
Begin of Item 0020
Format 2
srcBegin = A841
destBegin = 3143
End of Item 0020
Begin of Item 0021
Format 2
srcBegin = AC41
destBegin = 3145
End of Item 0021
Begin of Item 0022
Format 2
srcBegin = B041
destBegin = 3146
End of Item 0022
Begin of Item 0023
Format 2
srcBegin = B441
destBegin = 3147
End of Item 0023
Begin of Item 0024
Format 2
srcBegin = B841
destBegin = 3148
End of Item 0024
Begin of Item 0025
Format 2
srcBegin = BC41
destBegin = 3149
End of Item 0025
Begin of Item 0026
Format 2
srcBegin = C041
destBegin = 314A
End of Item 0026
Begin of Item 0027
Format 2
srcBegin = C441
destBegin = 314B
End of Item 0027
Begin of Item 0028
Format 2
srcBegin = C841
destBegin = 314C
End of Item 0028
Begin of Item 0029
Format 2
srcBegin = CC41
destBegin = 314D
End of Item 0029
Begin of Item 002A
Format 2
srcBegin = D041
destBegin = 314E
End of Item 002A
========================================================*/
/* Offset=0x0000 ItemOfList */
0x002B,
/*-------------------------------------------------------*/
/* Offset=0x0001 offsetToFormatArray */
0x0004,
/*-------------------------------------------------------*/
/* Offset=0x0002 offsetToMapCellArray */
0x000F,
/*-------------------------------------------------------*/
/* Offset=0x0003 offsetToMappingTable */
0x0090,
/*-------------------------------------------------------*/
/* Offset=0x0004 Start of Format Array */
/* Total of Format 0 : 0x0001 */
/* Total of Format 1 : 0x0001 */
/* Total of Format 2 : 0x0029 */
/* Total of Format 3 : 0x0000 */
0x2210, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222,
0x2222, 0x2222, 0x0222,
/*-------------------------------------------------------*/
/* Offset=0x000F Start of MapCell Array */
/* 0000 */ 0x844A, 0x8450, 0x313A,
/* 0001 */ 0x8444, 0x8447, 0x0000,
/* 0002 */ 0x8454, 0x0000, 0x3144,
/* 0003 */ 0x8461, 0x0000, 0x314F,
/* 0004 */ 0x8481, 0x0000, 0x3150,
/* 0005 */ 0x84A1, 0x0000, 0x3151,
/* 0006 */ 0x84C1, 0x0000, 0x3152,
/* 0007 */ 0x84E1, 0x0000, 0x3153,
/* 0008 */ 0x8541, 0x0000, 0x3154,
/* 0009 */ 0x8561, 0x0000, 0x3155,
/* 000A */ 0x8581, 0x0000, 0x3156,
/* 000B */ 0x85A1, 0x0000, 0x3157,
/* 000C */ 0x85C1, 0x0000, 0x3158,
/* 000D */ 0x85E1, 0x0000, 0x3159,
/* 000E */ 0x8641, 0x0000, 0x315A,
/* 000F */ 0x8661, 0x0000, 0x315B,
/* 0010 */ 0x8681, 0x0000, 0x315C,
/* 0011 */ 0x86A1, 0x0000, 0x315D,
/* 0012 */ 0x86C1, 0x0000, 0x315E,
/* 0013 */ 0x86E1, 0x0000, 0x315F,
/* 0014 */ 0x8741, 0x0000, 0x3160,
/* 0015 */ 0x8761, 0x0000, 0x3161,
/* 0016 */ 0x8781, 0x0000, 0x3162,
/* 0017 */ 0x87A1, 0x0000, 0x3163,
/* 0018 */ 0x8841, 0x0000, 0x3131,
/* 0019 */ 0x8C41, 0x0000, 0x3132,
/* 001A */ 0x9041, 0x0000, 0x3134,
/* 001B */ 0x9441, 0x0000, 0x3137,
/* 001C */ 0x9841, 0x0000, 0x3138,
/* 001D */ 0x9C41, 0x0000, 0x3139,
/* 001E */ 0xA041, 0x0000, 0x3141,
/* 001F */ 0xA441, 0x0000, 0x3142,
/* 0020 */ 0xA841, 0x0000, 0x3143,
/* 0021 */ 0xAC41, 0x0000, 0x3145,
/* 0022 */ 0xB041, 0x0000, 0x3146,
/* 0023 */ 0xB441, 0x0000, 0x3147,
/* 0024 */ 0xB841, 0x0000, 0x3148,
/* 0025 */ 0xBC41, 0x0000, 0x3149,
/* 0026 */ 0xC041, 0x0000, 0x314A,
/* 0027 */ 0xC441, 0x0000, 0x314B,
/* 0028 */ 0xC841, 0x0000, 0x314C,
/* 0029 */ 0xCC41, 0x0000, 0x314D,
/* 002A */ 0xD041, 0x0000, 0x314E,
/*-------------------------------------------------------*/
/* Offset=0x0090 Start of MappingTable */
/* 0000 */ 0x3133, 0xFFFD, 0x3135, 0x3136,
/* End of table Total Length = 0x0094 * 2 */

View File

@ -19,7 +19,7 @@
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Contributor(s): Jungshik Shin <jshin@mailaps.org>
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -51,6 +51,10 @@ static const PRUint16 g_JOHABHangulShiftTable[] = {
0, uJohabHangulCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0)
};
static const PRUint16 g_JOHABHangulCompatJamoShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0)
};
static const PRUint16 g_JOHABSymbolShiftTable[] = {
0, uJohabSymbolCharset,
@ -60,14 +64,19 @@ static const PRUint16 g_JOHABSymbolShiftTable[] = {
static const uRange g_JOHABRanges[] = {
{ 0x00, 0x7E },
{ 0x84, 0xD3 },
{ 0x84, 0xD3 },
{ 0xD8, 0xDE },
{ 0xE0, 0xF9 }
};
static const PRUint16 g_utJohabJamoMapping[] ={
#include "johabjamo.ut"
};
static const PRUint16 *g_JOHABShiftTableSet [] = {
g_ASCIIShiftTable,
g_JOHABHangulShiftTable,
g_JOHABHangulCompatJamoShiftTable,
g_JOHABSymbolShiftTable,
g_JOHABSymbolShiftTable
};
@ -75,6 +84,7 @@ static const PRUint16 *g_JOHABShiftTableSet [] = {
static const PRUint16 *g_JOHABMappingTableSet [] ={
g_AsciiMapping,
g_HangulNullMapping,
g_utJohabJamoMapping,
g_utKSC5601Mapping,
g_utKSC5601Mapping
};
@ -84,7 +94,7 @@ static const PRUint16 *g_JOHABMappingTableSet [] ={
// Class nsJohabToUnicode [implementation]
nsJohabToUnicode::nsJohabToUnicode()
: nsMultiTableDecoderSupport(4,
: nsMultiTableDecoderSupport(sizeof(g_JOHABRanges) / sizeof(g_JOHABRanges[0]),
(uRange*) &g_JOHABRanges,
(uShiftTable**) &g_JOHABShiftTableSet,
(uMappingTable**) &g_JOHABMappingTableSet)

View File

@ -46,5 +46,6 @@ extern "C" PRUint16 g_ufKSC5601Mapping[];
#define g_AsciiMapping ucvko_g_AsciiMapping
extern "C" PRUint16 g_AsciiMapping[];
extern "C" PRUint16 g_HangulNullMapping[];
extern "C" PRUint16 g_ufJohabJamoMapping[];
#endif /* nsUCvKODll_h___ */

View File

@ -22,6 +22,7 @@
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Roy Yokoyama <yokoyama@netscape.com>
* Jungshik Shin <jshin@mailaps.org>
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -85,6 +86,9 @@ PRUint16 g_AsciiMapping[] = {
PRUint16 g_HangulNullMapping[] ={
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
};
PRUint16 g_ufJohabJamoMapping[] ={
#include "johabjamo.uf"
};
NS_CONVERTER_REGISTRY_START
NS_UCONV_REG_UNREG("EUC-KR", NS_EUCKRTOUNICODE_CID, NS_UNICODETOEUCKR_CID)

View File

@ -19,7 +19,7 @@
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Contributor(s): Jungshik Shin <jshin@mailaps.org>
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -56,16 +56,22 @@ static const PRUint16 gJohabHangulShiftTable[] = {
0, uJohabHangulCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static const PRUint16 gJohabHangulCompatJamoShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static const PRUint16 *g_JohabMappingTable[3] = {
static const PRUint16 *g_JohabMappingTable[4] = {
g_AsciiMapping,
g_HangulNullMapping,
g_ufJohabJamoMapping,
g_ufKSC5601Mapping
};
static const PRUint16 *g_JohabShiftTable[3] = {
static const PRUint16 *g_JohabShiftTable[4] = {
gAsciiShiftTable,
gJohabHangulShiftTable,
gJohabHangulCompatJamoShiftTable,
gJohabSymbolShiftTable
};
@ -73,7 +79,7 @@ static const PRUint16 *g_JohabShiftTable[3] = {
// Class nsUnicodeToJohab [implementation]
nsUnicodeToJohab::nsUnicodeToJohab()
: nsMultiTableEncoderSupport(3,
: nsMultiTableEncoderSupport(sizeof(g_JohabShiftTable) / sizeof(g_JohabShiftTable[0]),
(uShiftTable**) g_JohabShiftTable,
(uMappingTable**) g_JohabMappingTable)
{

View File

@ -19,7 +19,7 @@
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Contributor(s): Jungshik Shin <jshin@mailaps.org>
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -52,22 +52,29 @@ static const PRUint16 gJohabHangulShiftTable[] = {
0, uJohabHangulCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static const PRUint16 gJohabHangulCompatJamoShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static const PRUint16 *g_JohabMappingTable[2] = {
static const PRUint16 *g_JohabMappingTable[3] = {
g_HangulNullMapping,
g_ufJohabJamoMapping,
g_ufKSC5601Mapping
};
static const PRUint16 *g_JohabShiftTable[2] = {
static const PRUint16 *g_JohabShiftTable[3] = {
gJohabHangulShiftTable,
gJohabHangulCompatJamoShiftTable,
gJohabSymbolShiftTable
};
//----------------------------------------------------------------------
// Class nsUnicodeToJohabNoAscii [implementation]
nsUnicodeToJohabNoAscii::nsUnicodeToJohabNoAscii()
: nsMultiTableEncoderSupport(2,
: nsMultiTableEncoderSupport(sizeof(g_JohabShiftTable) / sizeof(g_JohabShiftTable[0]),
(uShiftTable**) g_JohabShiftTable,
(uMappingTable**) g_JohabMappingTable)
{