mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-08 01:36:41 +08:00
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:
parent
d72a5c88ce
commit
3996b9d648
@ -46,6 +46,7 @@ set(
|
||||
nsEscCharsetProber.cpp
|
||||
nsEscSM.cpp
|
||||
nsGB2312Prober.cpp
|
||||
nsJohabProber.cpp
|
||||
nsMBCSGroupProber.cpp
|
||||
nsMBCSSM.cpp
|
||||
nsSBCSGroupProber.cpp
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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++)
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
|
||||
protected:
|
||||
void GetDistribution(PRUint32 aCharLen, const char* aStr);
|
||||
|
||||
|
||||
nsCodingStateMachine* mCodingSM;
|
||||
nsProbingState mState;
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user