Bug 964225 - Remove the GBK decoder class and remove GB2312 as a Gecko-canonical encoding. r=emk.
This commit is contained in:
@@ -13,28 +13,6 @@
|
||||
#include "nsGBKToUnicode.h"
|
||||
#include "gbku.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// nsGBKUnique2BytesToUnicode
|
||||
//------------------------------------------------------------
|
||||
class nsGBKUnique2BytesToUnicode : public nsTableDecoderSupport
|
||||
{
|
||||
public:
|
||||
nsGBKUnique2BytesToUnicode();
|
||||
virtual ~nsGBKUnique2BytesToUnicode()
|
||||
{ }
|
||||
protected:
|
||||
};
|
||||
|
||||
static const uint16_t g_utGBKUnique2Bytes[] = {
|
||||
#include "gbkuniq2b.ut"
|
||||
};
|
||||
nsGBKUnique2BytesToUnicode::nsGBKUnique2BytesToUnicode()
|
||||
: nsTableDecoderSupport(u2BytesCharset, nullptr,
|
||||
(uMappingTable*) &g_utGBKUnique2Bytes, 1)
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// nsGB18030Unique2BytesToUnicode
|
||||
//------------------------------------------------------------
|
||||
@@ -97,10 +75,10 @@ nsGB18030Unique4BytesToUnicode::nsGB18030Unique4BytesToUnicode()
|
||||
#define LEGAL_GBK_4BYTE_FORTH_BYTE(c) \
|
||||
(UINT8_IN_RANGE(0x30, (c), 0x39))
|
||||
|
||||
NS_IMETHODIMP nsGBKToUnicode::ConvertNoBuff(const char* aSrc,
|
||||
int32_t * aSrcLength,
|
||||
char16_t *aDest,
|
||||
int32_t * aDestLength)
|
||||
NS_IMETHODIMP nsGB18030ToUnicode::ConvertNoBuff(const char* aSrc,
|
||||
int32_t * aSrcLength,
|
||||
char16_t *aDest,
|
||||
int32_t * aDestLength)
|
||||
{
|
||||
int32_t i=0;
|
||||
int32_t iSrcLength = (*aSrcLength);
|
||||
@@ -229,15 +207,6 @@ NS_IMETHODIMP nsGBKToUnicode::ConvertNoBuff(const char* aSrc,
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
void nsGBKToUnicode::CreateExtensionDecoder()
|
||||
{
|
||||
mExtensionDecoder = new nsGBKUnique2BytesToUnicode();
|
||||
}
|
||||
void nsGBKToUnicode::Create4BytesDecoder()
|
||||
{
|
||||
m4BytesDecoder = nullptr;
|
||||
}
|
||||
void nsGB18030ToUnicode::CreateExtensionDecoder()
|
||||
{
|
||||
mExtensionDecoder = new nsGB18030Unique2BytesToUnicode();
|
||||
@@ -279,7 +248,7 @@ bool nsGB18030ToUnicode::DecodeToSurrogate(const char* aSrc, char16_t* aOut)
|
||||
|
||||
return true;
|
||||
}
|
||||
bool nsGBKToUnicode::TryExtensionDecoder(const char* aSrc, char16_t* aOut)
|
||||
bool nsGB18030ToUnicode::TryExtensionDecoder(const char* aSrc, char16_t* aOut)
|
||||
{
|
||||
if(!mExtensionDecoder)
|
||||
CreateExtensionDecoder();
|
||||
@@ -300,11 +269,8 @@ bool nsGBKToUnicode::TryExtensionDecoder(const char* aSrc, char16_t* aOut)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool nsGBKToUnicode::DecodeToSurrogate(const char* aSrc, char16_t* aOut)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool nsGBKToUnicode::Try4BytesDecoder(const char* aSrc, char16_t* aOut)
|
||||
|
||||
bool nsGB18030ToUnicode::Try4BytesDecoder(const char* aSrc, char16_t* aOut)
|
||||
{
|
||||
if(!m4BytesDecoder)
|
||||
Create4BytesDecoder();
|
||||
|
||||
Reference in New Issue
Block a user