Home | History | Annotate | Download | only in test

Lines Matching refs:ENCODING

3                      STRING, ENDMARKER, ENCODING, tok_name, detect_encoding,
31 [" ENCODING 'utf-8' (0, 0) (0, 0)"] +
955 allowed encoding for the comment is 'utf-8'. The text file used in
990 # skip the initial encoding token and the end token
991 tokens = list(_tokenize(readline, encoding='utf-8'))[1:-1]
994 "bytes not decoded with encoding")
1008 tokens = list(_tokenize(readline, encoding=None))[:-1]
1011 "string not tokenized when encoding is None")
1033 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1034 self.assertEqual(encoding, 'utf-8')
1043 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1044 self.assertEqual(encoding, 'utf-8-sig')
1054 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1055 self.assertEqual(encoding, 'iso-8859-1')
1064 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1065 self.assertEqual(encoding, 'utf-8-sig')
1084 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1085 self.assertEqual(encoding, 'ascii')
1096 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1097 self.assertEqual(encoding, 'utf-8-sig')
1117 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1118 self.assertEqual(encoding, 'utf-8')
1128 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1129 self.assertEqual(encoding, 'iso8859-15')
1139 encoding, consumed_lines = detect_encoding(self.get_readline(lines))
1140 self.assertEqual(encoding, 'iso8859-15')
1148 for encoding in encodings:
1150 enc = encoding.replace("-", rep)
1172 for encoding in encodings:
1174 enc = encoding.replace("-", rep)
1184 encoding, consumed_lines = detect_encoding(readline)
1185 self.assertEqual(encoding, 'utf-8')
1188 encoding, consumed_lines = detect_encoding(self.get_readline(()))
1189 self.assertEqual(encoding, 'utf-8')
1193 encoding, consumed_lines = detect_encoding(readline)
1194 self.assertEqual(encoding, 'utf-8-sig')
1198 encoding, consumed_lines = detect_encoding(readline)
1199 self.assertEqual(encoding, 'utf-8-sig')
1206 # Issue 18873: "Encoding" detected in non-comment lines
1208 encoding, consumed_lines = detect_encoding(readline)
1209 self.assertEqual(encoding, 'utf-8')
1217 for encoding in ('iso-8859-15', 'utf-8'):
1218 with open(filename, 'w', encoding=encoding) as fp:
1219 print("# coding: %s" % encoding, file=fp)
1222 self.assertEqual(fp.encoding, encoding)
1226 with open(filename, 'w', encoding='utf-8-sig') as fp:
1229 self.assertEqual(fp.encoding, 'utf-8-sig')
1272 encoding = object()
1275 return encoding, [b'first', b'second']
1277 def mock__tokenize(readline, encoding):
1279 encoding_used = encoding
1308 self.assertTrue(encoding_used, encoding)
1326 token.tok_name[ENCODING])
1430 tokens = [(ENCODING, 'utf-8'), token]
1437 self.assertEqual(u.encoding, 'utf-8')