25 # License along with this library; if not, write to the Free Software |
25 # License along with this library; if not, write to the Free Software |
26 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
26 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
27 # 02110-1301 USA |
27 # 02110-1301 USA |
28 ######################### END LICENSE BLOCK ######################### |
28 ######################### END LICENSE BLOCK ######################### |
29 |
29 |
30 import constants, sys |
30 from . import constants |
31 from constants import eStart, eError, eItsMe |
31 import sys |
32 from charsetprober import CharSetProber |
32 from .constants import eStart, eError, eItsMe |
|
33 from .charsetprober import CharSetProber |
33 |
34 |
34 class MultiByteCharSetProber(CharSetProber): |
35 class MultiByteCharSetProber(CharSetProber): |
35 def __init__(self): |
36 def __init__(self): |
36 CharSetProber.__init__(self) |
37 CharSetProber.__init__(self) |
37 self._mDistributionAnalyzer = None |
38 self._mDistributionAnalyzer = None |
38 self._mCodingSM = None |
39 self._mCodingSM = None |
39 self._mLastChar = ['\x00', '\x00'] |
40 self._mLastChar = [0, 0] |
40 |
41 |
41 def reset(self): |
42 def reset(self): |
42 CharSetProber.reset(self) |
43 CharSetProber.reset(self) |
43 if self._mCodingSM: |
44 if self._mCodingSM: |
44 self._mCodingSM.reset() |
45 self._mCodingSM.reset() |
45 if self._mDistributionAnalyzer: |
46 if self._mDistributionAnalyzer: |
46 self._mDistributionAnalyzer.reset() |
47 self._mDistributionAnalyzer.reset() |
47 self._mLastChar = ['\x00', '\x00'] |
48 self._mLastChar = [0, 0] |
48 |
49 |
49 def get_charset_name(self): |
50 def get_charset_name(self): |
50 pass |
51 pass |
51 |
52 |
52 def feed(self, aBuf): |
53 def feed(self, aBuf): |