Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/charset_normalizer/constant.py: 100%

21 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-26 07:30 +0000

1from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE 

2from encodings.aliases import aliases 

3from re import IGNORECASE, compile as re_compile 

4from typing import Dict, List, Set, Union 

5 

6from .assets import FREQUENCIES 

7 

8# Contain for each eligible encoding a list of/item bytes SIG/BOM 

9ENCODING_MARKS: Dict[str, Union[bytes, List[bytes]]] = { 

10 "utf_8": BOM_UTF8, 

11 "utf_7": [ 

12 b"\x2b\x2f\x76\x38", 

13 b"\x2b\x2f\x76\x39", 

14 b"\x2b\x2f\x76\x2b", 

15 b"\x2b\x2f\x76\x2f", 

16 b"\x2b\x2f\x76\x38\x2d", 

17 ], 

18 "gb18030": b"\x84\x31\x95\x33", 

19 "utf_32": [BOM_UTF32_BE, BOM_UTF32_LE], 

20 "utf_16": [BOM_UTF16_BE, BOM_UTF16_LE], 

21} 

22 

23TOO_SMALL_SEQUENCE: int = 32 

24TOO_BIG_SEQUENCE: int = int(10e6) 

25 

26UTF8_MAXIMAL_ALLOCATION: int = 1112064 

27 

28UNICODE_RANGES_COMBINED: Dict[str, range] = { 

29 "Control character": range(31 + 1), 

30 "Basic Latin": range(32, 127 + 1), 

31 "Latin-1 Supplement": range(128, 255 + 1), 

32 "Latin Extended-A": range(256, 383 + 1), 

33 "Latin Extended-B": range(384, 591 + 1), 

34 "IPA Extensions": range(592, 687 + 1), 

35 "Spacing Modifier Letters": range(688, 767 + 1), 

36 "Combining Diacritical Marks": range(768, 879 + 1), 

37 "Greek and Coptic": range(880, 1023 + 1), 

38 "Cyrillic": range(1024, 1279 + 1), 

39 "Cyrillic Supplement": range(1280, 1327 + 1), 

40 "Armenian": range(1328, 1423 + 1), 

41 "Hebrew": range(1424, 1535 + 1), 

42 "Arabic": range(1536, 1791 + 1), 

43 "Syriac": range(1792, 1871 + 1), 

44 "Arabic Supplement": range(1872, 1919 + 1), 

45 "Thaana": range(1920, 1983 + 1), 

46 "NKo": range(1984, 2047 + 1), 

47 "Samaritan": range(2048, 2111 + 1), 

48 "Mandaic": range(2112, 2143 + 1), 

49 "Syriac Supplement": range(2144, 2159 + 1), 

50 "Arabic Extended-A": range(2208, 2303 + 1), 

51 "Devanagari": range(2304, 2431 + 1), 

52 "Bengali": range(2432, 2559 + 1), 

53 "Gurmukhi": range(2560, 2687 + 1), 

54 "Gujarati": range(2688, 2815 + 1), 

55 "Oriya": range(2816, 2943 + 1), 

56 "Tamil": range(2944, 3071 + 1), 

57 "Telugu": range(3072, 3199 + 1), 

58 "Kannada": range(3200, 3327 + 1), 

59 "Malayalam": range(3328, 3455 + 1), 

60 "Sinhala": range(3456, 3583 + 1), 

61 "Thai": range(3584, 3711 + 1), 

62 "Lao": range(3712, 3839 + 1), 

63 "Tibetan": range(3840, 4095 + 1), 

64 "Myanmar": range(4096, 4255 + 1), 

65 "Georgian": range(4256, 4351 + 1), 

66 "Hangul Jamo": range(4352, 4607 + 1), 

67 "Ethiopic": range(4608, 4991 + 1), 

68 "Ethiopic Supplement": range(4992, 5023 + 1), 

69 "Cherokee": range(5024, 5119 + 1), 

70 "Unified Canadian Aboriginal Syllabics": range(5120, 5759 + 1), 

71 "Ogham": range(5760, 5791 + 1), 

72 "Runic": range(5792, 5887 + 1), 

73 "Tagalog": range(5888, 5919 + 1), 

74 "Hanunoo": range(5920, 5951 + 1), 

75 "Buhid": range(5952, 5983 + 1), 

76 "Tagbanwa": range(5984, 6015 + 1), 

77 "Khmer": range(6016, 6143 + 1), 

78 "Mongolian": range(6144, 6319 + 1), 

79 "Unified Canadian Aboriginal Syllabics Extended": range(6320, 6399 + 1), 

80 "Limbu": range(6400, 6479 + 1), 

81 "Tai Le": range(6480, 6527 + 1), 

82 "New Tai Lue": range(6528, 6623 + 1), 

83 "Khmer Symbols": range(6624, 6655 + 1), 

84 "Buginese": range(6656, 6687 + 1), 

85 "Tai Tham": range(6688, 6831 + 1), 

86 "Combining Diacritical Marks Extended": range(6832, 6911 + 1), 

87 "Balinese": range(6912, 7039 + 1), 

88 "Sundanese": range(7040, 7103 + 1), 

89 "Batak": range(7104, 7167 + 1), 

90 "Lepcha": range(7168, 7247 + 1), 

91 "Ol Chiki": range(7248, 7295 + 1), 

92 "Cyrillic Extended C": range(7296, 7311 + 1), 

93 "Sundanese Supplement": range(7360, 7375 + 1), 

94 "Vedic Extensions": range(7376, 7423 + 1), 

95 "Phonetic Extensions": range(7424, 7551 + 1), 

96 "Phonetic Extensions Supplement": range(7552, 7615 + 1), 

97 "Combining Diacritical Marks Supplement": range(7616, 7679 + 1), 

98 "Latin Extended Additional": range(7680, 7935 + 1), 

99 "Greek Extended": range(7936, 8191 + 1), 

100 "General Punctuation": range(8192, 8303 + 1), 

101 "Superscripts and Subscripts": range(8304, 8351 + 1), 

102 "Currency Symbols": range(8352, 8399 + 1), 

103 "Combining Diacritical Marks for Symbols": range(8400, 8447 + 1), 

104 "Letterlike Symbols": range(8448, 8527 + 1), 

105 "Number Forms": range(8528, 8591 + 1), 

106 "Arrows": range(8592, 8703 + 1), 

107 "Mathematical Operators": range(8704, 8959 + 1), 

108 "Miscellaneous Technical": range(8960, 9215 + 1), 

109 "Control Pictures": range(9216, 9279 + 1), 

110 "Optical Character Recognition": range(9280, 9311 + 1), 

111 "Enclosed Alphanumerics": range(9312, 9471 + 1), 

112 "Box Drawing": range(9472, 9599 + 1), 

113 "Block Elements": range(9600, 9631 + 1), 

114 "Geometric Shapes": range(9632, 9727 + 1), 

115 "Miscellaneous Symbols": range(9728, 9983 + 1), 

116 "Dingbats": range(9984, 10175 + 1), 

117 "Miscellaneous Mathematical Symbols-A": range(10176, 10223 + 1), 

118 "Supplemental Arrows-A": range(10224, 10239 + 1), 

119 "Braille Patterns": range(10240, 10495 + 1), 

120 "Supplemental Arrows-B": range(10496, 10623 + 1), 

121 "Miscellaneous Mathematical Symbols-B": range(10624, 10751 + 1), 

122 "Supplemental Mathematical Operators": range(10752, 11007 + 1), 

123 "Miscellaneous Symbols and Arrows": range(11008, 11263 + 1), 

124 "Glagolitic": range(11264, 11359 + 1), 

125 "Latin Extended-C": range(11360, 11391 + 1), 

126 "Coptic": range(11392, 11519 + 1), 

127 "Georgian Supplement": range(11520, 11567 + 1), 

128 "Tifinagh": range(11568, 11647 + 1), 

129 "Ethiopic Extended": range(11648, 11743 + 1), 

130 "Cyrillic Extended-A": range(11744, 11775 + 1), 

131 "Supplemental Punctuation": range(11776, 11903 + 1), 

132 "CJK Radicals Supplement": range(11904, 12031 + 1), 

133 "Kangxi Radicals": range(12032, 12255 + 1), 

134 "Ideographic Description Characters": range(12272, 12287 + 1), 

135 "CJK Symbols and Punctuation": range(12288, 12351 + 1), 

136 "Hiragana": range(12352, 12447 + 1), 

137 "Katakana": range(12448, 12543 + 1), 

138 "Bopomofo": range(12544, 12591 + 1), 

139 "Hangul Compatibility Jamo": range(12592, 12687 + 1), 

140 "Kanbun": range(12688, 12703 + 1), 

141 "Bopomofo Extended": range(12704, 12735 + 1), 

142 "CJK Strokes": range(12736, 12783 + 1), 

143 "Katakana Phonetic Extensions": range(12784, 12799 + 1), 

144 "Enclosed CJK Letters and Months": range(12800, 13055 + 1), 

145 "CJK Compatibility": range(13056, 13311 + 1), 

146 "CJK Unified Ideographs Extension A": range(13312, 19903 + 1), 

147 "Yijing Hexagram Symbols": range(19904, 19967 + 1), 

148 "CJK Unified Ideographs": range(19968, 40959 + 1), 

149 "Yi Syllables": range(40960, 42127 + 1), 

150 "Yi Radicals": range(42128, 42191 + 1), 

151 "Lisu": range(42192, 42239 + 1), 

152 "Vai": range(42240, 42559 + 1), 

153 "Cyrillic Extended-B": range(42560, 42655 + 1), 

154 "Bamum": range(42656, 42751 + 1), 

155 "Modifier Tone Letters": range(42752, 42783 + 1), 

156 "Latin Extended-D": range(42784, 43007 + 1), 

157 "Syloti Nagri": range(43008, 43055 + 1), 

158 "Common Indic Number Forms": range(43056, 43071 + 1), 

159 "Phags-pa": range(43072, 43135 + 1), 

160 "Saurashtra": range(43136, 43231 + 1), 

161 "Devanagari Extended": range(43232, 43263 + 1), 

162 "Kayah Li": range(43264, 43311 + 1), 

163 "Rejang": range(43312, 43359 + 1), 

164 "Hangul Jamo Extended-A": range(43360, 43391 + 1), 

165 "Javanese": range(43392, 43487 + 1), 

166 "Myanmar Extended-B": range(43488, 43519 + 1), 

167 "Cham": range(43520, 43615 + 1), 

168 "Myanmar Extended-A": range(43616, 43647 + 1), 

169 "Tai Viet": range(43648, 43743 + 1), 

170 "Meetei Mayek Extensions": range(43744, 43775 + 1), 

171 "Ethiopic Extended-A": range(43776, 43823 + 1), 

172 "Latin Extended-E": range(43824, 43887 + 1), 

173 "Cherokee Supplement": range(43888, 43967 + 1), 

174 "Meetei Mayek": range(43968, 44031 + 1), 

175 "Hangul Syllables": range(44032, 55215 + 1), 

176 "Hangul Jamo Extended-B": range(55216, 55295 + 1), 

177 "High Surrogates": range(55296, 56191 + 1), 

178 "High Private Use Surrogates": range(56192, 56319 + 1), 

179 "Low Surrogates": range(56320, 57343 + 1), 

180 "Private Use Area": range(57344, 63743 + 1), 

181 "CJK Compatibility Ideographs": range(63744, 64255 + 1), 

182 "Alphabetic Presentation Forms": range(64256, 64335 + 1), 

183 "Arabic Presentation Forms-A": range(64336, 65023 + 1), 

184 "Variation Selectors": range(65024, 65039 + 1), 

185 "Vertical Forms": range(65040, 65055 + 1), 

186 "Combining Half Marks": range(65056, 65071 + 1), 

187 "CJK Compatibility Forms": range(65072, 65103 + 1), 

188 "Small Form Variants": range(65104, 65135 + 1), 

189 "Arabic Presentation Forms-B": range(65136, 65279 + 1), 

190 "Halfwidth and Fullwidth Forms": range(65280, 65519 + 1), 

191 "Specials": range(65520, 65535 + 1), 

192 "Linear B Syllabary": range(65536, 65663 + 1), 

193 "Linear B Ideograms": range(65664, 65791 + 1), 

194 "Aegean Numbers": range(65792, 65855 + 1), 

195 "Ancient Greek Numbers": range(65856, 65935 + 1), 

196 "Ancient Symbols": range(65936, 65999 + 1), 

197 "Phaistos Disc": range(66000, 66047 + 1), 

198 "Lycian": range(66176, 66207 + 1), 

199 "Carian": range(66208, 66271 + 1), 

200 "Coptic Epact Numbers": range(66272, 66303 + 1), 

201 "Old Italic": range(66304, 66351 + 1), 

202 "Gothic": range(66352, 66383 + 1), 

203 "Old Permic": range(66384, 66431 + 1), 

204 "Ugaritic": range(66432, 66463 + 1), 

205 "Old Persian": range(66464, 66527 + 1), 

206 "Deseret": range(66560, 66639 + 1), 

207 "Shavian": range(66640, 66687 + 1), 

208 "Osmanya": range(66688, 66735 + 1), 

209 "Osage": range(66736, 66815 + 1), 

210 "Elbasan": range(66816, 66863 + 1), 

211 "Caucasian Albanian": range(66864, 66927 + 1), 

212 "Linear A": range(67072, 67455 + 1), 

213 "Cypriot Syllabary": range(67584, 67647 + 1), 

214 "Imperial Aramaic": range(67648, 67679 + 1), 

215 "Palmyrene": range(67680, 67711 + 1), 

216 "Nabataean": range(67712, 67759 + 1), 

217 "Hatran": range(67808, 67839 + 1), 

218 "Phoenician": range(67840, 67871 + 1), 

219 "Lydian": range(67872, 67903 + 1), 

220 "Meroitic Hieroglyphs": range(67968, 67999 + 1), 

221 "Meroitic Cursive": range(68000, 68095 + 1), 

222 "Kharoshthi": range(68096, 68191 + 1), 

223 "Old South Arabian": range(68192, 68223 + 1), 

224 "Old North Arabian": range(68224, 68255 + 1), 

225 "Manichaean": range(68288, 68351 + 1), 

226 "Avestan": range(68352, 68415 + 1), 

227 "Inscriptional Parthian": range(68416, 68447 + 1), 

228 "Inscriptional Pahlavi": range(68448, 68479 + 1), 

229 "Psalter Pahlavi": range(68480, 68527 + 1), 

230 "Old Turkic": range(68608, 68687 + 1), 

231 "Old Hungarian": range(68736, 68863 + 1), 

232 "Rumi Numeral Symbols": range(69216, 69247 + 1), 

233 "Brahmi": range(69632, 69759 + 1), 

234 "Kaithi": range(69760, 69839 + 1), 

235 "Sora Sompeng": range(69840, 69887 + 1), 

236 "Chakma": range(69888, 69967 + 1), 

237 "Mahajani": range(69968, 70015 + 1), 

238 "Sharada": range(70016, 70111 + 1), 

239 "Sinhala Archaic Numbers": range(70112, 70143 + 1), 

240 "Khojki": range(70144, 70223 + 1), 

241 "Multani": range(70272, 70319 + 1), 

242 "Khudawadi": range(70320, 70399 + 1), 

243 "Grantha": range(70400, 70527 + 1), 

244 "Newa": range(70656, 70783 + 1), 

245 "Tirhuta": range(70784, 70879 + 1), 

246 "Siddham": range(71040, 71167 + 1), 

247 "Modi": range(71168, 71263 + 1), 

248 "Mongolian Supplement": range(71264, 71295 + 1), 

249 "Takri": range(71296, 71375 + 1), 

250 "Ahom": range(71424, 71487 + 1), 

251 "Warang Citi": range(71840, 71935 + 1), 

252 "Zanabazar Square": range(72192, 72271 + 1), 

253 "Soyombo": range(72272, 72367 + 1), 

254 "Pau Cin Hau": range(72384, 72447 + 1), 

255 "Bhaiksuki": range(72704, 72815 + 1), 

256 "Marchen": range(72816, 72895 + 1), 

257 "Masaram Gondi": range(72960, 73055 + 1), 

258 "Cuneiform": range(73728, 74751 + 1), 

259 "Cuneiform Numbers and Punctuation": range(74752, 74879 + 1), 

260 "Early Dynastic Cuneiform": range(74880, 75087 + 1), 

261 "Egyptian Hieroglyphs": range(77824, 78895 + 1), 

262 "Anatolian Hieroglyphs": range(82944, 83583 + 1), 

263 "Bamum Supplement": range(92160, 92735 + 1), 

264 "Mro": range(92736, 92783 + 1), 

265 "Bassa Vah": range(92880, 92927 + 1), 

266 "Pahawh Hmong": range(92928, 93071 + 1), 

267 "Miao": range(93952, 94111 + 1), 

268 "Ideographic Symbols and Punctuation": range(94176, 94207 + 1), 

269 "Tangut": range(94208, 100351 + 1), 

270 "Tangut Components": range(100352, 101119 + 1), 

271 "Kana Supplement": range(110592, 110847 + 1), 

272 "Kana Extended-A": range(110848, 110895 + 1), 

273 "Nushu": range(110960, 111359 + 1), 

274 "Duployan": range(113664, 113823 + 1), 

275 "Shorthand Format Controls": range(113824, 113839 + 1), 

276 "Byzantine Musical Symbols": range(118784, 119039 + 1), 

277 "Musical Symbols": range(119040, 119295 + 1), 

278 "Ancient Greek Musical Notation": range(119296, 119375 + 1), 

279 "Tai Xuan Jing Symbols": range(119552, 119647 + 1), 

280 "Counting Rod Numerals": range(119648, 119679 + 1), 

281 "Mathematical Alphanumeric Symbols": range(119808, 120831 + 1), 

282 "Sutton SignWriting": range(120832, 121519 + 1), 

283 "Glagolitic Supplement": range(122880, 122927 + 1), 

284 "Mende Kikakui": range(124928, 125151 + 1), 

285 "Adlam": range(125184, 125279 + 1), 

286 "Arabic Mathematical Alphabetic Symbols": range(126464, 126719 + 1), 

287 "Mahjong Tiles": range(126976, 127023 + 1), 

288 "Domino Tiles": range(127024, 127135 + 1), 

289 "Playing Cards": range(127136, 127231 + 1), 

290 "Enclosed Alphanumeric Supplement": range(127232, 127487 + 1), 

291 "Enclosed Ideographic Supplement": range(127488, 127743 + 1), 

292 "Miscellaneous Symbols and Pictographs": range(127744, 128511 + 1), 

293 "Emoticons range(Emoji)": range(128512, 128591 + 1), 

294 "Ornamental Dingbats": range(128592, 128639 + 1), 

295 "Transport and Map Symbols": range(128640, 128767 + 1), 

296 "Alchemical Symbols": range(128768, 128895 + 1), 

297 "Geometric Shapes Extended": range(128896, 129023 + 1), 

298 "Supplemental Arrows-C": range(129024, 129279 + 1), 

299 "Supplemental Symbols and Pictographs": range(129280, 129535 + 1), 

300 "CJK Unified Ideographs Extension B": range(131072, 173791 + 1), 

301 "CJK Unified Ideographs Extension C": range(173824, 177983 + 1), 

302 "CJK Unified Ideographs Extension D": range(177984, 178207 + 1), 

303 "CJK Unified Ideographs Extension E": range(178208, 183983 + 1), 

304 "CJK Unified Ideographs Extension F": range(183984, 191471 + 1), 

305 "CJK Compatibility Ideographs Supplement": range(194560, 195103 + 1), 

306 "Tags": range(917504, 917631 + 1), 

307 "Variation Selectors Supplement": range(917760, 917999 + 1), 

308} 

309 

310 

311UNICODE_SECONDARY_RANGE_KEYWORD: List[str] = [ 

312 "Supplement", 

313 "Extended", 

314 "Extensions", 

315 "Modifier", 

316 "Marks", 

317 "Punctuation", 

318 "Symbols", 

319 "Forms", 

320 "Operators", 

321 "Miscellaneous", 

322 "Drawing", 

323 "Block", 

324 "Shapes", 

325 "Supplemental", 

326 "Tags", 

327] 

328 

329RE_POSSIBLE_ENCODING_INDICATION = re_compile( 

330 r"(?:(?:encoding)|(?:charset)|(?:coding))(?:[\:= ]{1,10})(?:[\"\']?)([a-zA-Z0-9\-_]+)(?:[\"\']?)", 

331 IGNORECASE, 

332) 

333 

334IANA_SUPPORTED: List[str] = sorted( 

335 filter( 

336 lambda x: x.endswith("_codec") is False 

337 and x not in {"rot_13", "tactis", "mbcs"}, 

338 list(set(aliases.values())), 

339 ) 

340) 

341 

342IANA_SUPPORTED_COUNT: int = len(IANA_SUPPORTED) 

343 

344# pre-computed code page that are similar using the function cp_similarity. 

345IANA_SUPPORTED_SIMILAR: Dict[str, List[str]] = { 

346 "cp037": ["cp1026", "cp1140", "cp273", "cp500"], 

347 "cp1026": ["cp037", "cp1140", "cp273", "cp500"], 

348 "cp1125": ["cp866"], 

349 "cp1140": ["cp037", "cp1026", "cp273", "cp500"], 

350 "cp1250": ["iso8859_2"], 

351 "cp1251": ["kz1048", "ptcp154"], 

352 "cp1252": ["iso8859_15", "iso8859_9", "latin_1"], 

353 "cp1253": ["iso8859_7"], 

354 "cp1254": ["iso8859_15", "iso8859_9", "latin_1"], 

355 "cp1257": ["iso8859_13"], 

356 "cp273": ["cp037", "cp1026", "cp1140", "cp500"], 

357 "cp437": ["cp850", "cp858", "cp860", "cp861", "cp862", "cp863", "cp865"], 

358 "cp500": ["cp037", "cp1026", "cp1140", "cp273"], 

359 "cp850": ["cp437", "cp857", "cp858", "cp865"], 

360 "cp857": ["cp850", "cp858", "cp865"], 

361 "cp858": ["cp437", "cp850", "cp857", "cp865"], 

362 "cp860": ["cp437", "cp861", "cp862", "cp863", "cp865"], 

363 "cp861": ["cp437", "cp860", "cp862", "cp863", "cp865"], 

364 "cp862": ["cp437", "cp860", "cp861", "cp863", "cp865"], 

365 "cp863": ["cp437", "cp860", "cp861", "cp862", "cp865"], 

366 "cp865": ["cp437", "cp850", "cp857", "cp858", "cp860", "cp861", "cp862", "cp863"], 

367 "cp866": ["cp1125"], 

368 "iso8859_10": ["iso8859_14", "iso8859_15", "iso8859_4", "iso8859_9", "latin_1"], 

369 "iso8859_11": ["tis_620"], 

370 "iso8859_13": ["cp1257"], 

371 "iso8859_14": [ 

372 "iso8859_10", 

373 "iso8859_15", 

374 "iso8859_16", 

375 "iso8859_3", 

376 "iso8859_9", 

377 "latin_1", 

378 ], 

379 "iso8859_15": [ 

380 "cp1252", 

381 "cp1254", 

382 "iso8859_10", 

383 "iso8859_14", 

384 "iso8859_16", 

385 "iso8859_3", 

386 "iso8859_9", 

387 "latin_1", 

388 ], 

389 "iso8859_16": [ 

390 "iso8859_14", 

391 "iso8859_15", 

392 "iso8859_2", 

393 "iso8859_3", 

394 "iso8859_9", 

395 "latin_1", 

396 ], 

397 "iso8859_2": ["cp1250", "iso8859_16", "iso8859_4"], 

398 "iso8859_3": ["iso8859_14", "iso8859_15", "iso8859_16", "iso8859_9", "latin_1"], 

399 "iso8859_4": ["iso8859_10", "iso8859_2", "iso8859_9", "latin_1"], 

400 "iso8859_7": ["cp1253"], 

401 "iso8859_9": [ 

402 "cp1252", 

403 "cp1254", 

404 "cp1258", 

405 "iso8859_10", 

406 "iso8859_14", 

407 "iso8859_15", 

408 "iso8859_16", 

409 "iso8859_3", 

410 "iso8859_4", 

411 "latin_1", 

412 ], 

413 "kz1048": ["cp1251", "ptcp154"], 

414 "latin_1": [ 

415 "cp1252", 

416 "cp1254", 

417 "cp1258", 

418 "iso8859_10", 

419 "iso8859_14", 

420 "iso8859_15", 

421 "iso8859_16", 

422 "iso8859_3", 

423 "iso8859_4", 

424 "iso8859_9", 

425 ], 

426 "mac_iceland": ["mac_roman", "mac_turkish"], 

427 "mac_roman": ["mac_iceland", "mac_turkish"], 

428 "mac_turkish": ["mac_iceland", "mac_roman"], 

429 "ptcp154": ["cp1251", "kz1048"], 

430 "tis_620": ["iso8859_11"], 

431} 

432 

433 

434CHARDET_CORRESPONDENCE: Dict[str, str] = { 

435 "iso2022_kr": "ISO-2022-KR", 

436 "iso2022_jp": "ISO-2022-JP", 

437 "euc_kr": "EUC-KR", 

438 "tis_620": "TIS-620", 

439 "utf_32": "UTF-32", 

440 "euc_jp": "EUC-JP", 

441 "koi8_r": "KOI8-R", 

442 "iso8859_1": "ISO-8859-1", 

443 "iso8859_2": "ISO-8859-2", 

444 "iso8859_5": "ISO-8859-5", 

445 "iso8859_6": "ISO-8859-6", 

446 "iso8859_7": "ISO-8859-7", 

447 "iso8859_8": "ISO-8859-8", 

448 "utf_16": "UTF-16", 

449 "cp855": "IBM855", 

450 "mac_cyrillic": "MacCyrillic", 

451 "gb2312": "GB2312", 

452 "gb18030": "GB18030", 

453 "cp932": "CP932", 

454 "cp866": "IBM866", 

455 "utf_8": "utf-8", 

456 "utf_8_sig": "UTF-8-SIG", 

457 "shift_jis": "SHIFT_JIS", 

458 "big5": "Big5", 

459 "cp1250": "windows-1250", 

460 "cp1251": "windows-1251", 

461 "cp1252": "Windows-1252", 

462 "cp1253": "windows-1253", 

463 "cp1255": "windows-1255", 

464 "cp1256": "windows-1256", 

465 "cp1254": "Windows-1254", 

466 "cp949": "CP949", 

467} 

468 

469 

470COMMON_SAFE_ASCII_CHARACTERS: Set[str] = { 

471 "<", 

472 ">", 

473 "=", 

474 ":", 

475 "/", 

476 "&", 

477 ";", 

478 "{", 

479 "}", 

480 "[", 

481 "]", 

482 ",", 

483 "|", 

484 '"', 

485 "-", 

486} 

487 

488 

489KO_NAMES: Set[str] = {"johab", "cp949", "euc_kr"} 

490ZH_NAMES: Set[str] = {"big5", "cp950", "big5hkscs", "hz"} 

491 

492LANGUAGE_SUPPORTED_COUNT: int = len(FREQUENCIES) 

493 

494# Logging LEVEL below DEBUG 

495TRACE: int = 5