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
Родитель 51dc6bbcef
Коммит c88d8515b9
7 изменённых файлов: 495 добавлений и 180 удалений

Просмотреть файл

@ -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 */

Просмотреть файл

@ -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 */

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -1,170 +0,0 @@
/* -*- Mode: C++; tab-width: 2; 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/
*
* 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 Communicator client 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.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Roy Yokoyama <yokoyama@netscape.com>
*
*
* 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 ***** */
#include "nspr.h"
#include "nsString.h"
#include "pratom.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsIRegistry.h"
#include "nsIGenericFactory.h"
#include "nsIServiceManager.h"
#include "nsICharsetConverterManager.h"
#include "nsIModule.h"
#include "nsUCvKOCID.h"
#include "nsUCvKODll.h"
#include "nsCRT.h"
#include "nsEUCKRToUnicode.h"
#include "nsUnicodeToEUCKR.h"
#include "nsUnicodeToKSC5601.h"
#include "nsUnicodeToX11Johab.h"
#include "nsJohabToUnicode.h"
#include "nsUnicodeToJohab.h"
#include "nsUnicodeToJohabNoAscii.h"
#include "nsCP949ToUnicode.h"
#include "nsUnicodeToCP949.h"
#include "nsISO2022KRToUnicode.h"
//----------------------------------------------------------------------------
// Global functions and data [declaration]
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
#define DECODER_NAME_BASE "Unicode Decoder-"
#define ENCODER_NAME_BASE "Unicode Encoder-"
PRUint16 g_utKSC5601Mapping[] = {
#include "u20kscgl.ut"
};
PRUint16 g_ufKSC5601Mapping[] = {
#include "u20kscgl.uf"
};
PRUint16 g_AsciiMapping[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
PRUint16 g_HangulNullMapping[] ={
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0xAC00, 0xD7A3, 0xAC00
};
NS_CONVERTER_REGISTRY_START
NS_UCONV_REG_UNREG("EUC-KR", NS_EUCKRTOUNICODE_CID, NS_UNICODETOEUCKR_CID)
NS_UCONV_REG_UNREG("x-johab", NS_JOHABTOUNICODE_CID, NS_UNICODETOJOHAB_CID)
NS_UCONV_REG_UNREG("x-windows-949", NS_CP949TOUNICODE_CID, NS_UNICODETOCP949_CID)
NS_UCONV_REG_UNREG_DECODER("ISO-2022-KR", NS_ISO2022KRTOUNICODE_CID)
NS_UCONV_REG_UNREG_ENCODER("ks_c_5601-1987", NS_UNICODETOKSC5601_CID)
NS_UCONV_REG_UNREG_ENCODER("x-x11johab", NS_UNICODETOX11JOHAB_CID)
NS_UCONV_REG_UNREG_ENCODER("x-johab-noascii", NS_UNICODETOJOHABNOASCII_CID)
NS_CONVERTER_REGISTRY_END
NS_IMPL_NSUCONVERTERREGSELF
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEUCKRToUnicode);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToEUCKR);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToKSC5601);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToX11Johab);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJohabToUnicode);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToJohab);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToJohabNoAscii);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCP949ToUnicode);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToCP949);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsISO2022KRToUnicode);
static const nsModuleComponentInfo components[] =
{
{
DECODER_NAME_BASE "EUC-KR" , NS_EUCKRTOUNICODE_CID,
NS_UNICODEDECODER_CONTRACTID_BASE "EUC-KR",
nsEUCKRToUnicodeConstructor ,
// global converter registration
nsUConverterRegSelf, nsUConverterUnregSelf,
},
{
ENCODER_NAME_BASE "EUC-KR" , NS_UNICODETOEUCKR_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "EUC-KR",
nsUnicodeToEUCKRConstructor,
},
{
ENCODER_NAME_BASE "ks_c_5601-1987" , NS_UNICODETOKSC5601_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "ks_c_5601-1987",
nsUnicodeToKSC5601Constructor,
},
{
ENCODER_NAME_BASE "x-x11johab" , NS_UNICODETOX11JOHAB_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "x-x11johab",
nsUnicodeToX11JohabConstructor,
},
{
DECODER_NAME_BASE "x-johab" , NS_JOHABTOUNICODE_CID,
NS_UNICODEDECODER_CONTRACTID_BASE "x-johab",
nsJohabToUnicodeConstructor ,
},
{
ENCODER_NAME_BASE "x-johab" , NS_UNICODETOJOHAB_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "x-johab",
nsUnicodeToJohabConstructor,
},
{
ENCODER_NAME_BASE "x-johab-noascii", NS_UNICODETOJOHABNOASCII_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "x-johab-noascii",
nsUnicodeToJohabNoAsciiConstructor,
},
{
DECODER_NAME_BASE "x-windows-949" , NS_CP949TOUNICODE_CID,
NS_UNICODEDECODER_CONTRACTID_BASE "x-windows-949",
nsCP949ToUnicodeConstructor ,
},
{
ENCODER_NAME_BASE "x-windows-949" , NS_UNICODETOCP949_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "x-windows-949",
nsUnicodeToCP949Constructor,
},
{
DECODER_NAME_BASE "ISO-2022-KR" , NS_ISO2022KRTOUNICODE_CID,
NS_UNICODEDECODER_CONTRACTID_BASE "ISO-2022-KR",
nsISO2022KRToUnicodeConstructor ,
}
};
NS_IMPL_NSGETMODULE(nsUCvKoModule, components);

Просмотреть файл

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

Просмотреть файл

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