Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/chardet/mbcssm.py: 98%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

48 statements  

1######################## BEGIN LICENSE BLOCK ######################## 

2# The Original Code is mozilla.org code. 

3# 

4# The Initial Developer of the Original Code is 

5# Netscape Communications Corporation. 

6# Portions created by the Initial Developer are Copyright (C) 1998 

7# the Initial Developer. All Rights Reserved. 

8# 

9# Contributor(s): 

10# Mark Pilgrim - port to Python 

11# 

12# This library is free software; you can redistribute it and/or 

13# modify it under the terms of the GNU Lesser General Public 

14# License as published by the Free Software Foundation; either 

15# version 2.1 of the License, or (at your option) any later version. 

16# 

17# This library is distributed in the hope that it will be useful, 

18# but WITHOUT ANY WARRANTY; without even the implied warranty of 

19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 

20# Lesser General Public License for more details. 

21# 

22# You should have received a copy of the GNU Lesser General Public 

23# License along with this library; if not, see 

24# <https://www.gnu.org/licenses/>. 

25######################### END LICENSE BLOCK ######################### 

26 

27from .codingstatemachinedict import CodingStateMachineDict 

28from .enums import MachineState 

29 

30# BIG5 

31 

32# fmt: off 

33BIG5_CLS = ( 

34 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 #allow 0x00 as legal value 

35 1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f 

36 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17 

37 1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f 

38 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27 

39 1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f 

40 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37 

41 1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f 

42 2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47 

43 2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f 

44 2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57 

45 2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f 

46 2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67 

47 2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f 

48 2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77 

49 2, 2, 2, 2, 2, 2, 2, 1, # 78 - 7f 

50 4, 4, 4, 4, 4, 4, 4, 4, # 80 - 87 

51 4, 4, 4, 4, 4, 4, 4, 4, # 88 - 8f 

52 4, 4, 4, 4, 4, 4, 4, 4, # 90 - 97 

53 4, 4, 4, 4, 4, 4, 4, 4, # 98 - 9f 

54 4, 3, 3, 3, 3, 3, 3, 3, # a0 - a7 

55 3, 3, 3, 3, 3, 3, 3, 3, # a8 - af 

56 3, 3, 3, 3, 3, 3, 3, 3, # b0 - b7 

57 3, 3, 3, 3, 3, 3, 3, 3, # b8 - bf 

58 3, 3, 3, 3, 3, 3, 3, 3, # c0 - c7 

59 3, 3, 3, 3, 3, 3, 3, 3, # c8 - cf 

60 3, 3, 3, 3, 3, 3, 3, 3, # d0 - d7 

61 3, 3, 3, 3, 3, 3, 3, 3, # d8 - df 

62 3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7 

63 3, 3, 3, 3, 3, 3, 3, 3, # e8 - ef 

64 3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7 

65 3, 3, 3, 3, 3, 3, 3, 0 # f8 - ff 

66) 

67 

68BIG5_ST = ( 

69 MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 

70 MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f 

71 MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17 

72) 

73# fmt: on 

74 

75BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0) 

76 

77BIG5_SM_MODEL: CodingStateMachineDict = { 

78 "class_table": BIG5_CLS, 

79 "class_factor": 5, 

80 "state_table": BIG5_ST, 

81 "char_len_table": BIG5_CHAR_LEN_TABLE, 

82 "name": "Big5", 

83} 

84 

85# CP949 

86# fmt: off 

87 

88""" 

89# Classes 

900: Unused 

911: 00-40, 5B-60, 7B-7F : Ascii 

922: C7-FD 

933: C9,FE : User-Defined Area 

944: 41-52 

955: 53-5A, 61-7A 

966: 81-A0 

977: A1-AC, B0-C5 

988: AD-AF 

999: C6 

100 

101# Byte 1 

102Ascii: 00-7F : 1 + 4 + 5 

103State 3: 81-AC, B0-C5 : 6 + 7 

104State 4: AD-AF : 8 

105State 5: C6 : 9 

106State 6: C7-FE : 2 (+ 3) 

107 

108 

109# Byte 2 

110State 3: 41-5A, 61-7A, 81-FE : 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 

111State 4: 41-5A, 61-7A, 81-A0 : 4 + 5 + 6 

112State 5: 41-52, A1-FE : 2 + 3 + 4 + 7 + 8 + 9 

113State 6: A1-FE : 2 + 3 + 7 + 8 + 9 

114""" 

115 

116CP949_CLS = ( 

117 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, # 00 - 0f 

118 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, # 10 - 1f 

119 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 2f 

120 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 3f 

121 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, # 40 - 4f 

122 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, # 50 - 5f 

123 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, # 60 - 6f 

124 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, # 70 - 7f 

125 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 80 - 8f 

126 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, # 90 - 9f 

127 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, # a0 - af 

128 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, # b0 - bf 

129 7, 7, 7, 7, 7, 7, 9, 2, 2, 3, 2, 2, 2, 2, 2, 2, # c0 - cf 

130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # d0 - df 

131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # e0 - ef 

132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, # f0 - ff 

133) 

134 

135CP949_ST = ( 

136 # 0 1 2 3 4 5 6 7 8 9 

137 MachineState.ERROR, MachineState.START, 6, MachineState.ERROR, MachineState.START, MachineState.START, 3, 3, 4, 5, # START 

138 MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, # ERROR 

139 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # ITSME 

140 MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.START, MachineState.START, MachineState.START, MachineState.START, MachineState.START, MachineState.START, # 3 

141 MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.START, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, # 4 

142 MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.START, MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.START, # 5 

143 MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.ERROR, MachineState.ERROR, MachineState.ERROR, MachineState.START, MachineState.START, MachineState.START, # 6 

144) 

145# fmt: on 

146 

147CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 2, 2) 

148 

149CP949_SM_MODEL: CodingStateMachineDict = { 

150 "class_table": CP949_CLS, 

151 "class_factor": 10, 

152 "state_table": CP949_ST, 

153 "char_len_table": CP949_CHAR_LEN_TABLE, 

154 "name": "CP949", 

155} 

156 

157# EUC-JP 

158# fmt: off 

159EUCJP_CLS = ( 

160 4, 4, 4, 4, 4, 4, 4, 4, # 00 - 07 

161 4, 4, 4, 4, 4, 4, 5, 5, # 08 - 0f 

162 4, 4, 4, 4, 4, 4, 4, 4, # 10 - 17 

163 4, 4, 4, 5, 4, 4, 4, 4, # 18 - 1f 

164 4, 4, 4, 4, 4, 4, 4, 4, # 20 - 27 

165 4, 4, 4, 4, 4, 4, 4, 4, # 28 - 2f 

166 4, 4, 4, 4, 4, 4, 4, 4, # 30 - 37 

167 4, 4, 4, 4, 4, 4, 4, 4, # 38 - 3f 

168 4, 4, 4, 4, 4, 4, 4, 4, # 40 - 47 

169 4, 4, 4, 4, 4, 4, 4, 4, # 48 - 4f 

170 4, 4, 4, 4, 4, 4, 4, 4, # 50 - 57 

171 4, 4, 4, 4, 4, 4, 4, 4, # 58 - 5f 

172 4, 4, 4, 4, 4, 4, 4, 4, # 60 - 67 

173 4, 4, 4, 4, 4, 4, 4, 4, # 68 - 6f 

174 4, 4, 4, 4, 4, 4, 4, 4, # 70 - 77 

175 4, 4, 4, 4, 4, 4, 4, 4, # 78 - 7f 

176 5, 5, 5, 5, 5, 5, 5, 5, # 80 - 87 

177 5, 5, 5, 5, 5, 5, 1, 3, # 88 - 8f 

178 5, 5, 5, 5, 5, 5, 5, 5, # 90 - 97 

179 5, 5, 5, 5, 5, 5, 5, 5, # 98 - 9f 

180 5, 2, 2, 2, 2, 2, 2, 2, # a0 - a7 

181 2, 2, 2, 2, 2, 2, 2, 2, # a8 - af 

182 2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7 

183 2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf 

184 2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7 

185 2, 2, 2, 2, 2, 2, 2, 2, # c8 - cf 

186 2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7 

187 2, 2, 2, 2, 2, 2, 2, 2, # d8 - df 

188 0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7 

189 0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef 

190 0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7 

191 0, 0, 0, 0, 0, 0, 0, 5 # f8 - ff 

192) 

193 

194EUCJP_ST = ( 

195 3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 

196 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

197 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 

198 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f 

199 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27 

200) 

201# fmt: on 

202 

203EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0) 

204 

205EUCJP_SM_MODEL: CodingStateMachineDict = { 

206 "class_table": EUCJP_CLS, 

207 "class_factor": 6, 

208 "state_table": EUCJP_ST, 

209 "char_len_table": EUCJP_CHAR_LEN_TABLE, 

210 "name": "EUC-JP", 

211} 

212 

213# EUC-KR 

214# fmt: off 

215EUCKR_CLS = ( 

216 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 

217 1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f 

218 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17 

219 1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f 

220 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27 

221 1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f 

222 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37 

223 1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f 

224 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 47 

225 1, 1, 1, 1, 1, 1, 1, 1, # 48 - 4f 

226 1, 1, 1, 1, 1, 1, 1, 1, # 50 - 57 

227 1, 1, 1, 1, 1, 1, 1, 1, # 58 - 5f 

228 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 67 

229 1, 1, 1, 1, 1, 1, 1, 1, # 68 - 6f 

230 1, 1, 1, 1, 1, 1, 1, 1, # 70 - 77 

231 1, 1, 1, 1, 1, 1, 1, 1, # 78 - 7f 

232 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87 

233 0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f 

234 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97 

235 0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f 

236 0, 2, 2, 2, 2, 2, 2, 2, # a0 - a7 

237 2, 2, 2, 2, 2, 3, 3, 3, # a8 - af 

238 2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7 

239 2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf 

240 2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7 

241 2, 3, 2, 2, 2, 2, 2, 2, # c8 - cf 

242 2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7 

243 2, 2, 2, 2, 2, 2, 2, 2, # d8 - df 

244 2, 2, 2, 2, 2, 2, 2, 2, # e0 - e7 

245 2, 2, 2, 2, 2, 2, 2, 2, # e8 - ef 

246 2, 2, 2, 2, 2, 2, 2, 2, # f0 - f7 

247 2, 2, 2, 2, 2, 2, 2, 0 # f8 - ff 

248) 

249 

250EUCKR_ST = ( 

251 MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 

252 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f 

253) 

254# fmt: on 

255 

256EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0) 

257 

258EUCKR_SM_MODEL: CodingStateMachineDict = { 

259 "class_table": EUCKR_CLS, 

260 "class_factor": 4, 

261 "state_table": EUCKR_ST, 

262 "char_len_table": EUCKR_CHAR_LEN_TABLE, 

263 "name": "EUC-KR", 

264} 

265 

266# JOHAB 

267# fmt: off 

268JOHAB_CLS = ( 

269 4,4,4,4,4,4,4,4, # 00 - 07 

270 4,4,4,4,4,4,0,0, # 08 - 0f 

271 4,4,4,4,4,4,4,4, # 10 - 17 

272 4,4,4,0,4,4,4,4, # 18 - 1f 

273 4,4,4,4,4,4,4,4, # 20 - 27 

274 4,4,4,4,4,4,4,4, # 28 - 2f 

275 4,3,3,3,3,3,3,3, # 30 - 37 

276 3,3,3,3,3,3,3,3, # 38 - 3f 

277 3,1,1,1,1,1,1,1, # 40 - 47 

278 1,1,1,1,1,1,1,1, # 48 - 4f 

279 1,1,1,1,1,1,1,1, # 50 - 57 

280 1,1,1,1,1,1,1,1, # 58 - 5f 

281 1,1,1,1,1,1,1,1, # 60 - 67 

282 1,1,1,1,1,1,1,1, # 68 - 6f 

283 1,1,1,1,1,1,1,1, # 70 - 77 

284 1,1,1,1,1,1,1,2, # 78 - 7f 

285 6,6,6,6,8,8,8,8, # 80 - 87 

286 8,8,8,8,8,8,8,8, # 88 - 8f 

287 8,7,7,7,7,7,7,7, # 90 - 97 

288 7,7,7,7,7,7,7,7, # 98 - 9f 

289 7,7,7,7,7,7,7,7, # a0 - a7 

290 7,7,7,7,7,7,7,7, # a8 - af 

291 7,7,7,7,7,7,7,7, # b0 - b7 

292 7,7,7,7,7,7,7,7, # b8 - bf 

293 7,7,7,7,7,7,7,7, # c0 - c7 

294 7,7,7,7,7,7,7,7, # c8 - cf 

295 7,7,7,7,5,5,5,5, # d0 - d7 

296 5,9,9,9,9,9,9,5, # d8 - df 

297 9,9,9,9,9,9,9,9, # e0 - e7 

298 9,9,9,9,9,9,9,9, # e8 - ef 

299 9,9,9,9,9,9,9,9, # f0 - f7 

300 9,9,5,5,5,5,5,0 # f8 - ff 

301) 

302 

303JOHAB_ST = ( 

304# cls = 0 1 2 3 4 5 6 7 8 9 

305 MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,3 ,3 ,4 , # MachineState.START 

306 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME 

307 MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR , # MachineState.ERROR 

308 MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START , # 3 

309 MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START , # 4 

310) 

311# fmt: on 

312 

313JOHAB_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 0, 0, 2, 2, 2) 

314 

315JOHAB_SM_MODEL: CodingStateMachineDict = { 

316 "class_table": JOHAB_CLS, 

317 "class_factor": 10, 

318 "state_table": JOHAB_ST, 

319 "char_len_table": JOHAB_CHAR_LEN_TABLE, 

320 "name": "Johab", 

321} 

322 

323# EUC-TW 

324# fmt: off 

325EUCTW_CLS = ( 

326 2, 2, 2, 2, 2, 2, 2, 2, # 00 - 07 

327 2, 2, 2, 2, 2, 2, 0, 0, # 08 - 0f 

328 2, 2, 2, 2, 2, 2, 2, 2, # 10 - 17 

329 2, 2, 2, 0, 2, 2, 2, 2, # 18 - 1f 

330 2, 2, 2, 2, 2, 2, 2, 2, # 20 - 27 

331 2, 2, 2, 2, 2, 2, 2, 2, # 28 - 2f 

332 2, 2, 2, 2, 2, 2, 2, 2, # 30 - 37 

333 2, 2, 2, 2, 2, 2, 2, 2, # 38 - 3f 

334 2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47 

335 2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f 

336 2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57 

337 2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f 

338 2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67 

339 2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f 

340 2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77 

341 2, 2, 2, 2, 2, 2, 2, 2, # 78 - 7f 

342 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87 

343 0, 0, 0, 0, 0, 0, 6, 0, # 88 - 8f 

344 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97 

345 0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f 

346 0, 3, 4, 4, 4, 4, 4, 4, # a0 - a7 

347 5, 5, 1, 1, 1, 1, 1, 1, # a8 - af 

348 1, 1, 1, 1, 1, 1, 1, 1, # b0 - b7 

349 1, 1, 1, 1, 1, 1, 1, 1, # b8 - bf 

350 1, 1, 3, 1, 3, 3, 3, 3, # c0 - c7 

351 3, 3, 3, 3, 3, 3, 3, 3, # c8 - cf 

352 3, 3, 3, 3, 3, 3, 3, 3, # d0 - d7 

353 3, 3, 3, 3, 3, 3, 3, 3, # d8 - df 

354 3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7 

355 3, 3, 3, 3, 3, 3, 3, 3, # e8 - ef 

356 3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7 

357 3, 3, 3, 3, 3, 3, 3, 0 # f8 - ff 

358) 

359 

360EUCTW_ST = ( 

361 MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07 

362 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

363 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17 

364 MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f 

365 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27 

366 MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f 

367) 

368# fmt: on 

369 

370EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3) 

371 

372EUCTW_SM_MODEL: CodingStateMachineDict = { 

373 "class_table": EUCTW_CLS, 

374 "class_factor": 7, 

375 "state_table": EUCTW_ST, 

376 "char_len_table": EUCTW_CHAR_LEN_TABLE, 

377 "name": "x-euc-tw", 

378} 

379 

380# GB2312 

381# fmt: off 

382GB2312_CLS = ( 

383 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 

384 1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f 

385 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17 

386 1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f 

387 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27 

388 1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f 

389 3, 3, 3, 3, 3, 3, 3, 3, # 30 - 37 

390 3, 3, 1, 1, 1, 1, 1, 1, # 38 - 3f 

391 2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47 

392 2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f 

393 2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57 

394 2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f 

395 2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67 

396 2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f 

397 2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77 

398 2, 2, 2, 2, 2, 2, 2, 4, # 78 - 7f 

399 5, 6, 6, 6, 6, 6, 6, 6, # 80 - 87 

400 6, 6, 6, 6, 6, 6, 6, 6, # 88 - 8f 

401 6, 6, 6, 6, 6, 6, 6, 6, # 90 - 97 

402 6, 6, 6, 6, 6, 6, 6, 6, # 98 - 9f 

403 6, 6, 6, 6, 6, 6, 6, 6, # a0 - a7 

404 6, 6, 6, 6, 6, 6, 6, 6, # a8 - af 

405 6, 6, 6, 6, 6, 6, 6, 6, # b0 - b7 

406 6, 6, 6, 6, 6, 6, 6, 6, # b8 - bf 

407 6, 6, 6, 6, 6, 6, 6, 6, # c0 - c7 

408 6, 6, 6, 6, 6, 6, 6, 6, # c8 - cf 

409 6, 6, 6, 6, 6, 6, 6, 6, # d0 - d7 

410 6, 6, 6, 6, 6, 6, 6, 6, # d8 - df 

411 6, 6, 6, 6, 6, 6, 6, 6, # e0 - e7 

412 6, 6, 6, 6, 6, 6, 6, 6, # e8 - ef 

413 6, 6, 6, 6, 6, 6, 6, 6, # f0 - f7 

414 6, 6, 6, 6, 6, 6, 6, 0 # f8 - ff 

415) 

416 

417GB2312_ST = ( 

418 MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07 

419 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

420 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17 

421 4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f 

422 MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27 

423 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f 

424) 

425# fmt: on 

426 

427# To be accurate, the length of class 6 can be either 2 or 4. 

428# But it is not necessary to discriminate between the two since 

429# it is used for frequency analysis only, and we are validating 

430# each code range there as well. So it is safe to set it to be 

431# 2 here. 

432GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2) 

433 

434GB2312_SM_MODEL: CodingStateMachineDict = { 

435 "class_table": GB2312_CLS, 

436 "class_factor": 7, 

437 "state_table": GB2312_ST, 

438 "char_len_table": GB2312_CHAR_LEN_TABLE, 

439 "name": "GB2312", 

440} 

441 

442# Shift_JIS 

443# fmt: off 

444SJIS_CLS = ( 

445 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 

446 1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f 

447 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17 

448 1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f 

449 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27 

450 1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f 

451 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37 

452 1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f 

453 2, 2, 2, 2, 2, 2, 2, 2, # 40 - 47 

454 2, 2, 2, 2, 2, 2, 2, 2, # 48 - 4f 

455 2, 2, 2, 2, 2, 2, 2, 2, # 50 - 57 

456 2, 2, 2, 2, 2, 2, 2, 2, # 58 - 5f 

457 2, 2, 2, 2, 2, 2, 2, 2, # 60 - 67 

458 2, 2, 2, 2, 2, 2, 2, 2, # 68 - 6f 

459 2, 2, 2, 2, 2, 2, 2, 2, # 70 - 77 

460 2, 2, 2, 2, 2, 2, 2, 1, # 78 - 7f 

461 3, 3, 3, 3, 3, 2, 2, 3, # 80 - 87 

462 3, 3, 3, 3, 3, 3, 3, 3, # 88 - 8f 

463 3, 3, 3, 3, 3, 3, 3, 3, # 90 - 97 

464 3, 3, 3, 3, 3, 3, 3, 3, # 98 - 9f 

465 #0xa0 is illegal in sjis encoding, but some pages does 

466 #contain such byte. We need to be more error forgiven. 

467 2, 2, 2, 2, 2, 2, 2, 2, # a0 - a7 

468 2, 2, 2, 2, 2, 2, 2, 2, # a8 - af 

469 2, 2, 2, 2, 2, 2, 2, 2, # b0 - b7 

470 2, 2, 2, 2, 2, 2, 2, 2, # b8 - bf 

471 2, 2, 2, 2, 2, 2, 2, 2, # c0 - c7 

472 2, 2, 2, 2, 2, 2, 2, 2, # c8 - cf 

473 2, 2, 2, 2, 2, 2, 2, 2, # d0 - d7 

474 2, 2, 2, 2, 2, 2, 2, 2, # d8 - df 

475 3, 3, 3, 3, 3, 3, 3, 3, # e0 - e7 

476 3, 3, 3, 3, 3, 4, 4, 4, # e8 - ef 

477 3, 3, 3, 3, 3, 3, 3, 3, # f0 - f7 

478 3, 3, 3, 3, 3, 0, 0, 0, # f8 - ff 

479) 

480 

481SJIS_ST = ( 

482 MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 

483 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

484 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17 

485) 

486# fmt: on 

487 

488SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0) 

489 

490SJIS_SM_MODEL: CodingStateMachineDict = { 

491 "class_table": SJIS_CLS, 

492 "class_factor": 6, 

493 "state_table": SJIS_ST, 

494 "char_len_table": SJIS_CHAR_LEN_TABLE, 

495 "name": "Shift_JIS", 

496} 

497 

498# UCS2-BE 

499# fmt: off 

500UCS2BE_CLS = ( 

501 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 07 

502 0, 0, 1, 0, 0, 2, 0, 0, # 08 - 0f 

503 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 17 

504 0, 0, 0, 3, 0, 0, 0, 0, # 18 - 1f 

505 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 27 

506 0, 3, 3, 3, 3, 3, 0, 0, # 28 - 2f 

507 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 37 

508 0, 0, 0, 0, 0, 0, 0, 0, # 38 - 3f 

509 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 47 

510 0, 0, 0, 0, 0, 0, 0, 0, # 48 - 4f 

511 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 57 

512 0, 0, 0, 0, 0, 0, 0, 0, # 58 - 5f 

513 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 67 

514 0, 0, 0, 0, 0, 0, 0, 0, # 68 - 6f 

515 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 77 

516 0, 0, 0, 0, 0, 0, 0, 0, # 78 - 7f 

517 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87 

518 0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f 

519 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97 

520 0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f 

521 0, 0, 0, 0, 0, 0, 0, 0, # a0 - a7 

522 0, 0, 0, 0, 0, 0, 0, 0, # a8 - af 

523 0, 0, 0, 0, 0, 0, 0, 0, # b0 - b7 

524 0, 0, 0, 0, 0, 0, 0, 0, # b8 - bf 

525 0, 0, 0, 0, 0, 0, 0, 0, # c0 - c7 

526 0, 0, 0, 0, 0, 0, 0, 0, # c8 - cf 

527 0, 0, 0, 0, 0, 0, 0, 0, # d0 - d7 

528 0, 0, 0, 0, 0, 0, 0, 0, # d8 - df 

529 0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7 

530 0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef 

531 0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7 

532 0, 0, 0, 0, 0, 0, 4, 5 # f8 - ff 

533) 

534 

535UCS2BE_ST = ( 

536 5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 

537 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

538 MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17 

539 6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f 

540 6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27 

541 5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f 

542 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37 

543) 

544# fmt: on 

545 

546UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2) 

547 

548UCS2BE_SM_MODEL: CodingStateMachineDict = { 

549 "class_table": UCS2BE_CLS, 

550 "class_factor": 6, 

551 "state_table": UCS2BE_ST, 

552 "char_len_table": UCS2BE_CHAR_LEN_TABLE, 

553 "name": "UTF-16BE", 

554} 

555 

556# UCS2-LE 

557# fmt: off 

558UCS2LE_CLS = ( 

559 0, 0, 0, 0, 0, 0, 0, 0, # 00 - 07 

560 0, 0, 1, 0, 0, 2, 0, 0, # 08 - 0f 

561 0, 0, 0, 0, 0, 0, 0, 0, # 10 - 17 

562 0, 0, 0, 3, 0, 0, 0, 0, # 18 - 1f 

563 0, 0, 0, 0, 0, 0, 0, 0, # 20 - 27 

564 0, 3, 3, 3, 3, 3, 0, 0, # 28 - 2f 

565 0, 0, 0, 0, 0, 0, 0, 0, # 30 - 37 

566 0, 0, 0, 0, 0, 0, 0, 0, # 38 - 3f 

567 0, 0, 0, 0, 0, 0, 0, 0, # 40 - 47 

568 0, 0, 0, 0, 0, 0, 0, 0, # 48 - 4f 

569 0, 0, 0, 0, 0, 0, 0, 0, # 50 - 57 

570 0, 0, 0, 0, 0, 0, 0, 0, # 58 - 5f 

571 0, 0, 0, 0, 0, 0, 0, 0, # 60 - 67 

572 0, 0, 0, 0, 0, 0, 0, 0, # 68 - 6f 

573 0, 0, 0, 0, 0, 0, 0, 0, # 70 - 77 

574 0, 0, 0, 0, 0, 0, 0, 0, # 78 - 7f 

575 0, 0, 0, 0, 0, 0, 0, 0, # 80 - 87 

576 0, 0, 0, 0, 0, 0, 0, 0, # 88 - 8f 

577 0, 0, 0, 0, 0, 0, 0, 0, # 90 - 97 

578 0, 0, 0, 0, 0, 0, 0, 0, # 98 - 9f 

579 0, 0, 0, 0, 0, 0, 0, 0, # a0 - a7 

580 0, 0, 0, 0, 0, 0, 0, 0, # a8 - af 

581 0, 0, 0, 0, 0, 0, 0, 0, # b0 - b7 

582 0, 0, 0, 0, 0, 0, 0, 0, # b8 - bf 

583 0, 0, 0, 0, 0, 0, 0, 0, # c0 - c7 

584 0, 0, 0, 0, 0, 0, 0, 0, # c8 - cf 

585 0, 0, 0, 0, 0, 0, 0, 0, # d0 - d7 

586 0, 0, 0, 0, 0, 0, 0, 0, # d8 - df 

587 0, 0, 0, 0, 0, 0, 0, 0, # e0 - e7 

588 0, 0, 0, 0, 0, 0, 0, 0, # e8 - ef 

589 0, 0, 0, 0, 0, 0, 0, 0, # f0 - f7 

590 0, 0, 0, 0, 0, 0, 4, 5 # f8 - ff 

591) 

592 

593UCS2LE_ST = ( 

594 6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 

595 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f 

596 MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17 

597 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f 

598 7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27 

599 5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f 

600 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37 

601) 

602# fmt: on 

603 

604UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2) 

605 

606UCS2LE_SM_MODEL: CodingStateMachineDict = { 

607 "class_table": UCS2LE_CLS, 

608 "class_factor": 6, 

609 "state_table": UCS2LE_ST, 

610 "char_len_table": UCS2LE_CHAR_LEN_TABLE, 

611 "name": "UTF-16LE", 

612} 

613 

614# UTF-8 

615# fmt: off 

616UTF8_CLS = ( 

617 1, 1, 1, 1, 1, 1, 1, 1, # 00 - 07 #allow 0x00 as a legal value 

618 1, 1, 1, 1, 1, 1, 0, 0, # 08 - 0f 

619 1, 1, 1, 1, 1, 1, 1, 1, # 10 - 17 

620 1, 1, 1, 0, 1, 1, 1, 1, # 18 - 1f 

621 1, 1, 1, 1, 1, 1, 1, 1, # 20 - 27 

622 1, 1, 1, 1, 1, 1, 1, 1, # 28 - 2f 

623 1, 1, 1, 1, 1, 1, 1, 1, # 30 - 37 

624 1, 1, 1, 1, 1, 1, 1, 1, # 38 - 3f 

625 1, 1, 1, 1, 1, 1, 1, 1, # 40 - 47 

626 1, 1, 1, 1, 1, 1, 1, 1, # 48 - 4f 

627 1, 1, 1, 1, 1, 1, 1, 1, # 50 - 57 

628 1, 1, 1, 1, 1, 1, 1, 1, # 58 - 5f 

629 1, 1, 1, 1, 1, 1, 1, 1, # 60 - 67 

630 1, 1, 1, 1, 1, 1, 1, 1, # 68 - 6f 

631 1, 1, 1, 1, 1, 1, 1, 1, # 70 - 77 

632 1, 1, 1, 1, 1, 1, 1, 1, # 78 - 7f 

633 2, 2, 2, 2, 3, 3, 3, 3, # 80 - 87 

634 4, 4, 4, 4, 4, 4, 4, 4, # 88 - 8f 

635 4, 4, 4, 4, 4, 4, 4, 4, # 90 - 97 

636 4, 4, 4, 4, 4, 4, 4, 4, # 98 - 9f 

637 5, 5, 5, 5, 5, 5, 5, 5, # a0 - a7 

638 5, 5, 5, 5, 5, 5, 5, 5, # a8 - af 

639 5, 5, 5, 5, 5, 5, 5, 5, # b0 - b7 

640 5, 5, 5, 5, 5, 5, 5, 5, # b8 - bf 

641 0, 0, 6, 6, 6, 6, 6, 6, # c0 - c7 

642 6, 6, 6, 6, 6, 6, 6, 6, # c8 - cf 

643 6, 6, 6, 6, 6, 6, 6, 6, # d0 - d7 

644 6, 6, 6, 6, 6, 6, 6, 6, # d8 - df 

645 7, 8, 8, 8, 8, 8, 8, 8, # e0 - e7 

646 8, 8, 8, 8, 8, 9, 8, 8, # e8 - ef 

647 10, 11, 11, 11, 11, 11, 11, 11, # f0 - f7 

648 12, 13, 13, 13, 14, 15, 0, 0 # f8 - ff 

649) 

650 

651UTF8_ST = ( 

652 MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07 

653 9, 11, 8, 7, 6, 5, 4, 3,#08-0f 

654 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 

655 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f 

656 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27 

657 MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f 

658 MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37 

659 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f 

660 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47 

661 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f 

662 MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57 

663 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f 

664 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67 

665 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f 

666 MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77 

667 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f 

668 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87 

669 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f 

670 MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97 

671 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f 

672 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7 

673 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af 

674 MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7 

675 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf 

676 MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7 

677 MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf 

678) 

679# fmt: on 

680 

681UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6) 

682 

683UTF8_SM_MODEL: CodingStateMachineDict = { 

684 "class_table": UTF8_CLS, 

685 "class_factor": 16, 

686 "state_table": UTF8_ST, 

687 "char_len_table": UTF8_CHAR_LEN_TABLE, 

688 "name": "UTF-8", 

689}