Lines Matching defs:encoding

79     tok->encoding = NULL;
203 invoke the set_readline function for the new encoding.
204 This function receives the tok_state and the new encoding.
235 if (tok->encoding == NULL) {
239 PyErr_Format(PyExc_SyntaxError, "encoding problem: %s", cs);
243 tok->encoding = cs;
245 if (strcmp(tok->encoding, cs) != 0) {
248 "encoding problem: %s with BOM", cs);
258 invoke the set_readline function with the new encoding.
290 if (tok->encoding != NULL)
291 PyMem_Free(tok->encoding);
292 tok->encoding = new_string("utf-8", 5, tok);
293 if (!tok->encoding)
431 ENC is usually identical to the future value of tok->encoding,
575 "but no encoding declared; "
599 tokenizer, this means to just record the encoding. */
607 /* Return a UTF-8 encoding Python string object from the
669 Look for encoding declarations inside STR, and record them
767 tok->encoding = new_string("utf-8", 5, tok);
768 if (!tok->encoding) {
797 /* Must copy encoding declaration since it
799 tok->encoding = new_string(enc, strlen(enc), tok);
800 if (!tok->encoding) {
814 if (tok->encoding != NULL) {
815 PyMem_Free(tok->encoding);
894 if (tok->encoding && newtok && *newtok) {
898 PyObject *u = translate_into_utf8(newtok, tok->encoding);
969 /* We have not yet determined the encoding.
970 If an encoding is found, use the file-pointer
1013 /* The default encoding is UTF-8, so make sure we don't have any
1015 if (!tok->encoding && !ensure_utf8(tok->cur, tok)) {
2177 /* Get the encoding of a Python file. Check for the coding cookie and check if
2181 encoding in the first or second line of the file (in which case the encoding
2194 char *encoding = NULL;
2214 return encoding;
2218 // if fetching the encoding shows a warning.
2224 if (tok->encoding) {
2225 encoding = (char *)PyMem_Malloc(strlen(tok->encoding) + 1);
2226 if (encoding) {
2227 strcpy(encoding, tok->encoding);
2231 return encoding;