Adding a new converter for HKSCS (contribution from Gavin.Ho@compaq.com), bug 25226, r=nhotta, ftang, sr=erik.

This commit is contained in:
nhotta%netscape.com 2001-03-28 00:05:21 +00:00
Родитель 309ff2e156
Коммит f5981be777
5 изменённых файлов: 47 добавлений и 0 удалений

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

@ -34,6 +34,8 @@ REQUIRES = xpcom string uconv
CPPSRCS = \
nsBIG5ToUnicode.cpp \
nsUnicodeToBIG5.cpp \
nsBIG5HKSCSToUnicode.cpp \
nsUnicodeToBIG5HKSCS.cpp \
nsCP950ToUnicode.cpp \
nsUnicodeToCP950.cpp \
nsUnicodeToBIG5NoAscii.cpp \

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

@ -32,6 +32,8 @@ DLL=.\$(OBJDIR)\$(DLLNAME).dll
CPPSRCS = \
nsBIG5ToUnicode.cpp \
nsUnicodeToBIG5.cpp \
nsBIG5HKSCSToUnicode.cpp \
nsUnicodeToBIG5HKSCS.cpp \
nsCP950ToUnicode.cpp \
nsUnicodeToCP950.cpp \
nsUnicodeToBIG5NoAscii.cpp \
@ -42,6 +44,8 @@ CPPSRCS = \
CPP_OBJS= \
.\$(OBJDIR)\nsBIG5ToUnicode.obj \
.\$(OBJDIR)\nsUnicodeToBIG5.obj \
.\$(OBJDIR)\nsBIG5HKSCSToUnicode.obj \
.\$(OBJDIR)\nsUnicodeToBIG5HKSCS.obj \
.\$(OBJDIR)\nsCP950ToUnicode.obj \
.\$(OBJDIR)\nsUnicodeToCP950.obj \
.\$(OBJDIR)\nsUnicodeToBIG5NoAscii.obj \

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

@ -63,4 +63,18 @@ NS_DECLARE_ID(kUnicodeToCP950CID,
{ 0x9416bfbb, 0x1f93, 0x11d3, {0xb3, 0xbf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70}}
// Class ID for our BIG5HKSCSToUnicode charset converter
// {BA6151BB-EC62-11d2-8AAC-00600811A836}
NS_DECLARE_ID(kBIG5HKSCSToUnicodeCID,
0xba6151bb, 0xec62, 0x11d2, 0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36);
#define NS_BIG5HKSCSTOUNICODE_CID \
{ 0xba6151bb, 0xec62, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
// Class ID for our UnicodeToBIG5HKSCS charset converter
// {BA6151BC-EC62-11d2-8AAC-00600811A836}
NS_DECLARE_ID(kUnicodeToBIG5HKSCSCID,
0xba6151bc, 0xec62, 0x11d2, 0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36);
#define NS_UNICODETOBIG5HKSCS_CID \
{ 0xba6151bc, 0xec62, 0x11d2, {0x8a, 0xac, 0x0, 0x60, 0x8, 0x11, 0xa8, 0x36}}
#endif /* nsUCvTWCID_h___ */

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

@ -30,5 +30,7 @@ extern "C" PRInt32 g_LockCount;
extern "C" PRUint16 g_ufBig5Mapping[];
extern "C" PRUint16 g_utBIG5Mapping[];
extern "C" PRUint16 g_ASCIIMapping[];
extern "C" PRUint16 g_ufBig5HKSCSMapping[];
extern "C" PRUint16 g_utBig5HKSCSMapping[];
#endif /* nsUCvTWDll_h___ */

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

@ -37,6 +37,8 @@
#include "nsBIG5ToUnicode.h"
#include "nsUnicodeToBIG5.h"
#include "nsUnicodeToBIG5NoAscii.h"
#include "nsBIG5HKSCSToUnicode.h"
#include "nsUnicodeToBIG5HKSCS.h"
//----------------------------------------------------------------------------
// Global functions and data [declaration]
@ -61,16 +63,27 @@ PRUint16 g_ASCIIMapping[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
PRUint16 g_ufBig5HKSCSMapping[] = {
#include "hkscs.uf"
};
PRUint16 g_utBig5HKSCSMapping[] = {
#include "hkscs.ut"
};
NS_IMPL_NSUCONVERTERREGSELF
NS_UCONV_REG_UNREG(nsBIG5ToUnicode, "Big5", "Unicode" , NS_BIG5TOUNICODE_CID);
NS_UCONV_REG_UNREG(nsUnicodeToBIG5NoAscii, "Unicode", "x-x-big5", NS_UNICODETOBIG5NOASCII_CID);
NS_UCONV_REG_UNREG(nsUnicodeToBIG5, "Unicode", "Big5" , NS_UNICODETOBIG5_CID);
NS_UCONV_REG_UNREG(nsBIG5HKSCSToUnicode, "Big5-HKSCS", "Unicode" , NS_BIG5HKSCSTOUNICODE_CID);
NS_UCONV_REG_UNREG(nsUnicodeToBIG5HKSCS, "Unicode", "Big5-HKSCS" , NS_UNICODETOBIG5HKSCS_CID);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBIG5ToUnicode);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToBIG5);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToBIG5NoAscii);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBIG5HKSCSToUnicode);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToBIG5HKSCS);
static nsModuleComponentInfo components[] =
{
@ -91,6 +104,18 @@ static nsModuleComponentInfo components[] =
NS_UNICODEDECODER_CONTRACTID_BASE "Big5",
nsBIG5ToUnicodeConstructor ,
nsBIG5ToUnicodeRegSelf , nsBIG5ToUnicodeUnRegSelf
},
{
ENCODER_NAME_BASE "Big5-HKSCS" , NS_UNICODETOBIG5HKSCS_CID,
NS_UNICODEENCODER_CONTRACTID_BASE "Big5-HKSCS",
nsUnicodeToBIG5HKSCSConstructor,
nsUnicodeToBIG5HKSCSRegSelf, nsUnicodeToBIG5HKSCSUnRegSelf
},
{
DECODER_NAME_BASE "Big5-HKSCS" , NS_BIG5HKSCSTOUNICODE_CID,
NS_UNICODEDECODER_CONTRACTID_BASE "Big5-HKSCS",
nsBIG5HKSCSToUnicodeConstructor ,
nsBIG5HKSCSToUnicodeRegSelf , nsBIG5HKSCSToUnicodeUnRegSelf
}
};