public EUCJPProber() { codingSM = new CodingStateMachine(new EUCJPSMModel()); distributionAnalyser = new EUCJPDistributionAnalyser(); contextAnalyser = new EUCJPContextAnalyser(); Reset(); }
public SJISProber() { codingSM = new CodingStateMachine(new SJISSMModel()); distributionAnalyser = new SJISDistributionAnalyser(); contextAnalyser = new SJISContextAnalyser(); Reset(); }
public GB18030Prober() { lastChar = new byte[2]; codingSM = new CodingStateMachine(new GB18030SMModel()); analyser = new GB18030DistributionAnalyser(); Reset(); }
public EscCharsetProber() { codingSM = new CodingStateMachine[CHARSETS_NUM]; codingSM[0] = new CodingStateMachine(new HZSMModel()); codingSM[1] = new CodingStateMachine(new ISO2022CNSMModel()); codingSM[2] = new CodingStateMachine(new ISO2022JPSMModel()); codingSM[3] = new CodingStateMachine(new ISO2022KRSMModel()); Reset(); }
public override ProbingState HandleData(byte[] buf, int offset, int len) { int max = offset + len; for (int i = offset; i < max && state == ProbingState.Detecting; i++) { for (int j = activeSM - 1; j >= 0; j--) { // byte is feed to all active state machine int codingState = codingSM[j].NextState(buf[i]); if (codingState == SMModel.ERROR) { // got negative answer for this state machine, make it inactive activeSM--; if (activeSM == 0) { state = ProbingState.NotMe; return(state); } else if (j != activeSM) { CodingStateMachine t = codingSM[activeSM]; codingSM[activeSM] = codingSM[j]; codingSM[j] = t; } } else if (codingState == SMModel.ITSME) { state = ProbingState.FoundIt; detectedCharset = codingSM[j].ModelName; return(state); } } } return(state); }
public EUCTWProber() { this.codingSM = new CodingStateMachine(new EUCTWSMModel()); this.distributionAnalyser = new EUCTWDistributionAnalyser(); this.Reset(); }
public EUCKRProber() { codingSM = new CodingStateMachine(new EUCKRSMModel()); distributionAnalyser = new EUCKRDistributionAnalyser(); Reset(); }
public Big5Prober() { this.codingSM = new CodingStateMachine(new BIG5SMModel()); this.distributionAnalyser = new BIG5DistributionAnalyser(); this.Reset(); }
public UTF8Prober() { numOfMBChar = 0; codingSM = new CodingStateMachine(new UTF8SMModel()); Reset(); }
public UTF8Prober() { this.numOfMBChar = 0; this.codingSM = new CodingStateMachine(new UTF8SMModel()); this.Reset(); }