src: build new charset prober for Johab Korean.

CMake build was not completed and enum state nsSMState disappeared in
commit 53f7ad0.
Also fixing a few coding style bugs.

See discussion in MR !1.
This commit is contained in:
Jehan 2021-03-14 12:59:25 +01:00
parent d72a5c88ce
commit 3996b9d648
6 changed files with 8 additions and 6 deletions

View File

@ -46,6 +46,7 @@ set(
nsEscCharsetProber.cpp
nsEscSM.cpp
nsGB2312Prober.cpp
nsJohabProber.cpp
nsMBCSGroupProber.cpp
nsMBCSSM.cpp
nsSBCSGroupProber.cpp

View File

@ -164,7 +164,7 @@ class JohabDistributionAnalysis : public CharDistributionAnalysis
public:
JohabDistributionAnalysis();
protected:
//for Johab encoding, we are interested
//for Johab encoding, we are interested
// first byte range: 0x88 -- 0xd3
// second byte range: 0x41 -- 0xfe
//no validation needed here. State machine has done that

View File

@ -56,7 +56,7 @@ static const PRUint8 JohabJong[32] = {
0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0xff, 0xff,
};
//Johab to EUC-KR Order
//Johab to EUC-KR Order
static const PRInt16 JohabToEUCKROrder[] =
{
0, 1, -1, -1, 2, -1, -1, 3, 4, 5, 6, -1, -1, -1, -1, -1,

View File

@ -39,7 +39,7 @@
void nsJohabProber::Reset(void)
{
mCodingSM->Reset();
mCodingSM->Reset();
mState = eDetecting;
mDistributionAnalyser.Reset(mIsPreferredLanguage);
//mContextAnalyser.Reset();
@ -47,7 +47,7 @@ void nsJohabProber::Reset(void)
nsProbingState nsJohabProber::HandleData(const char* aBuf, PRUint32 aLen)
{
nsSMState codingState;
PRUint32 codingState;
for (PRUint32 i = 0; i < aLen; i++)
{

View File

@ -59,7 +59,7 @@ public:
protected:
void GetDistribution(PRUint32 aCharLen, const char* aStr);
nsCodingStateMachine* mCodingSM;
nsProbingState mState;

View File

@ -74,7 +74,8 @@ nsMBCSGroupProber::nsMBCSGroupProber(PRUint32 aLanguageFilter)
}
if (aLanguageFilter & NS_FILTER_CHINESE_SIMPLIFIED)
mProbers[3] = new nsGB18030Prober(aLanguageFilter == NS_FILTER_CHINESE_SIMPLIFIED);
if (aLanguageFilter & NS_FILTER_KOREAN) {
if (aLanguageFilter & NS_FILTER_KOREAN)
{
mProbers[4] = new nsEUCKRProber(aLanguageFilter == NS_FILTER_KOREAN);
mProbers[7] = new nsJohabProber(aLanguageFilter == NS_FILTER_KOREAN);
}