fix bug 4672, 4673, 4674, 4676 , check in for cata from ftang's account

git-svn-id: svn://10.0.0.236/trunk@26757 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ftang%netscape.com
1999-04-07 23:00:28 +00:00
parent 150dad921b
commit 0a33089e24
9 changed files with 171 additions and 35 deletions

View File

@@ -25,19 +25,43 @@
static PRUint16 g_BIG5MappingTable[] = {
#include "big5.ut"
};
static PRUint16 g_ASCIIMappingTable[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
static PRInt16 g_BIG5ShiftTable[] = {
2, uMultibytesCharset,
ShiftCell(u1ByteChar, 1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
ShiftCell(u2BytesChar, 2, 0xA1, 0xFE, 0xA1, 0x40, 0xFE, 0xFE)
0, u2BytesCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 g_ASCIIShiftTable[] = {
0, u1ByteCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 *g_BIG5ShiftTableSet [] = {
g_ASCIIShiftTable,
g_BIG5ShiftTable
};
static PRUint16 *g_BIG5MappingTableSet [] ={
g_ASCIIMappingTable,
g_BIG5MappingTable
};
static uRange g_BIG5Ranges[] = {
{ 0x00, 0x7E },
{ 0x81, 0xFC }
};
//----------------------------------------------------------------------
// Class nsBIG5ToUnicode [implementation]
nsBIG5ToUnicode::nsBIG5ToUnicode()
: nsTableDecoderSupport((uShiftTable*) &g_BIG5ShiftTable,
(uMappingTable*) &g_BIG5MappingTable)
: nsTablesDecoderSupport(2,
(uRange* ) &g_BIG5Ranges,
(uShiftTable**) &g_BIG5ShiftTableSet,
(uMappingTable**) &g_BIG5MappingTableSet)
{
}
@@ -48,7 +72,7 @@ nsresult nsBIG5ToUnicode::CreateInstance(nsISupports ** aResult)
}
//----------------------------------------------------------------------
// Subclassing of nsTableDecoderSupport class [implementation]
// Subclassing of nsTablesDecoderSupport class [implementation]
NS_IMETHODIMP nsBIG5ToUnicode::GetMaxLength(const char * aSrc,
PRInt32 aSrcLength,

View File

@@ -31,7 +31,7 @@
* @created 06/Apr/1999
* @author Catalin Rotaru [CATA]
*/
class nsBIG5ToUnicode : public nsTableDecoderSupport
class nsBIG5ToUnicode : public nsTablesDecoderSupport
{
public:

View File

@@ -22,22 +22,66 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRUint16 g_ASCIIMappingTable[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
static PRInt16 g_ASCIIShiftTable[] = {
0, u1ByteCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
#ifdef MS_EUCKR
static PRUint16 g_EUCKRMappingTable[] = {
#include "u20ksc.ut"
};
static PRInt16 g_EUCKRShiftTable[] = {
0, u2BytesCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0)
};
static uRange g_EUCKRRanges[] = {
{ 0x00, 0x7E },
{ 0x81, 0xFE }
};
#else
static PRUint16 g_EUCKRMappingTable[] = {
#include "u20kscgl.ut"
};
static PRInt16 g_EUCKRShiftTable[] = {
2, uMultibytesCharset,
ShiftCell(u1ByteChar, 1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
ShiftCell(u2BytesChar, 2, 0xA1, 0xFE, 0xA1, 0x40, 0xFE, 0xFE)
0, u2BytesGRCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0)
};
static uRange g_EUCKRRanges[] = {
{ 0x00, 0x7E },
{ 0xA1, 0xFE }
};
#endif
static PRInt16 *g_EUCKRShiftTableSet [] = {
g_ASCIIShiftTable,
g_EUCKRShiftTable
};
static PRUint16 *g_EUCKRMappingTableSet [] ={
g_ASCIIMappingTable,
g_EUCKRMappingTable
};
//----------------------------------------------------------------------
// Class nsEUCKRToUnicode [implementation]
nsEUCKRToUnicode::nsEUCKRToUnicode()
: nsTableDecoderSupport((uShiftTable*) &g_EUCKRShiftTable,
(uMappingTable*) &g_EUCKRMappingTable)
: nsTablesDecoderSupport(2,
(uRange*) &g_EUCKRRanges,
(uShiftTable**) &g_EUCKRShiftTableSet,
(uMappingTable**) &g_EUCKRMappingTableSet)
{
}
@@ -48,7 +92,7 @@ nsresult nsEUCKRToUnicode::CreateInstance(nsISupports ** aResult)
}
//----------------------------------------------------------------------
// Subclassing of nsTableDecoderSupport class [implementation]
// Subclassing of nsTablesDecoderSupport class [implementation]
NS_IMETHODIMP nsEUCKRToUnicode::GetMaxLength(const char * aSrc,
PRInt32 aSrcLength,

View File

@@ -31,7 +31,7 @@
* @created 06/Apr/1999
* @author Catalin Rotaru [CATA]
*/
class nsEUCKRToUnicode : public nsTableDecoderSupport
class nsEUCKRToUnicode : public nsTablesDecoderSupport
{
public:

View File

@@ -22,22 +22,62 @@
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRUint16 g_EUCTWMappingTable[] = {
static PRUint16 g_ASCIIMappingTable[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
static PRUint16 g_CNS1MappingTable[] = {
#include "cns_1.ut"
};
static PRInt16 g_EUCTWShiftTable[] = {
2, uMultibytesCharset,
ShiftCell(u1ByteChar, 1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
ShiftCell(u2BytesChar, 2, 0xA1, 0xFE, 0xA1, 0x40, 0xFE, 0xFE)
static PRUint16 g_CNS2MappingTable[] = {
#include "cns_2.ut"
};
static PRInt16 g_ASCIIShiftTable[] = {
0, u1ByteCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 g_CNS1ShiftTable[] = {
0, u2BytesGRCharset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static PRInt16 g_CNS2ShiftTable[] = {
0, u2BytesGRPrefix8EA2Charset,
ShiftCell(0, 0, 0, 0, 0, 0, 0, 0),
};
static PRInt16 *g_EUCTWShiftTableSet [] = {
g_ASCIIShiftTable,
g_CNS1ShiftTable,
g_CNS2ShiftTable
};
static PRUint16 *g_EUCTWMappingTableSet [] ={
g_ASCIIMappingTable,
g_CNS1MappingTable,
g_CNS2MappingTable
};
static uRange g_EUCTWRanges[] = {
{ 0x00, 0x7E },
{ 0xA1, 0xFE },
{ 0x8E, 0x8E }
};
//----------------------------------------------------------------------
// Class nsEUCTWToUnicode [implementation]
nsEUCTWToUnicode::nsEUCTWToUnicode()
: nsTableDecoderSupport((uShiftTable*) &g_EUCTWShiftTable,
(uMappingTable*) &g_EUCTWMappingTable)
: nsTablesDecoderSupport(3,
(uRange*) &g_EUCTWRanges,
(uShiftTable**) &g_EUCTWShiftTableSet,
(uMappingTable**) &g_EUCTWMappingTableSet)
{
}
@@ -48,7 +88,7 @@ nsresult nsEUCTWToUnicode::CreateInstance(nsISupports ** aResult)
}
//----------------------------------------------------------------------
// Subclassing of nsTableDecoderSupport class [implementation]
// Subclassing of nsTablesDecoderSupport class [implementation]
NS_IMETHODIMP nsEUCTWToUnicode::GetMaxLength(const char * aSrc,
PRInt32 aSrcLength,

View File

@@ -31,7 +31,7 @@
* @created 06/Apr/1999
* @author Catalin Rotaru [CATA]
*/
class nsEUCTWToUnicode : public nsTableDecoderSupport
class nsEUCTWToUnicode : public nsTablesDecoderSupport
{
public:

View File

@@ -19,25 +19,53 @@
#include "nsGB2312ToUnicode.h"
//----------------------------------------------------------------------
// Global functions and data [declaration]
static PRUint16 g_ASCIIMappingTable[] = {
0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000
};
static PRUint16 g_GB2312MappingTable[] = {
#include "gb2312.ut"
};
static PRInt16 g_GB2312ShiftTable[] = {
2, uMultibytesCharset,
ShiftCell(u1ByteChar, 1, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x7F),
ShiftCell(u2BytesChar, 2, 0xA1, 0xFE, 0xA1, 0x40, 0xFE, 0xFE)
static PRInt16 g_ASCIIShiftTable[] = {
0, u1ByteCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 g_GB2312ShiftTable[] = {
0, u2BytesGRCharset,
ShiftCell(0,0,0,0,0,0,0,0)
};
static PRInt16 *g_GB2312ShiftTableSet [] = {
g_ASCIIShiftTable,
g_GB2312ShiftTable
};
static PRUint16 *g_GB2312MappingTableSet [] ={
g_ASCIIMappingTable,
g_GB2312MappingTable
};
static uRange g_GB2312Ranges[] = {
{ 0x00, 0x7E },
{ 0xA1, 0xFE }
};
//----------------------------------------------------------------------
// Class nsGB2312ToUnicode [implementation]
nsGB2312ToUnicode::nsGB2312ToUnicode()
: nsTableDecoderSupport((uShiftTable*) &g_GB2312ShiftTable,
(uMappingTable*) &g_GB2312MappingTable)
: nsTablesDecoderSupport(2,
(uRange *) &g_GB2312Ranges,
(uShiftTable**) &g_GB2312ShiftTableSet,
(uMappingTable**) &g_GB2312MappingTableSet)
{
}
@@ -48,7 +76,7 @@ nsresult nsGB2312ToUnicode::CreateInstance(nsISupports ** aResult)
}
//----------------------------------------------------------------------
// Subclassing of nsTableDecoderSupport class [implementation]
// Subclassing of nsTablesDecoderSupport class [implementation]
NS_IMETHODIMP nsGB2312ToUnicode::GetMaxLength(const char * aSrc,
PRInt32 aSrcLength,

View File

@@ -31,7 +31,7 @@
* @created 06/Apr/1999
* @author Catalin Rotaru [CATA]
*/
class nsGB2312ToUnicode : public nsTableDecoderSupport
class nsGB2312ToUnicode : public nsTablesDecoderSupport
{
public:

View File

@@ -75,7 +75,7 @@ FactoryData g_FactoryData[] =
{
&kEUCTWToUnicodeCID,
nsEUCTWToUnicode::CreateInstance,
"EUCTW",
"X-EUC-TW",
"Unicode"
},
{
@@ -87,7 +87,7 @@ FactoryData g_FactoryData[] =
{
&kEUCKRToUnicodeCID,
nsEUCKRToUnicode::CreateInstance,
"EUCKR",
"EUC-KR",
"Unicode"
},
{
@@ -100,7 +100,7 @@ FactoryData g_FactoryData[] =
&kUnicodeToEUCTWCID,
nsUnicodeToEUCTW::CreateInstance,
"Unicode",
"EUCTW"
"X-EUC-TW"
},
{
&kUnicodeToGB2312CID,
@@ -112,7 +112,7 @@ FactoryData g_FactoryData[] =
&kUnicodeToEUCKRCID,
nsUnicodeToEUCKR::CreateInstance,
"Unicode",
"EUCKR"
"EUC-KR"
}
};