diff options
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/tokenizer.c | 4 | ||||
-rw-r--r-- | Parser/tokenizer.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 4edf6d0..ce8129d 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -135,6 +135,7 @@ tok_new(void) tok->decoding_state = STATE_INIT; tok->decoding_erred = 0; tok->read_coding_spec = 0; + tok->enc = NULL; tok->encoding = NULL; tok->cont_line = 0; #ifndef PGEN @@ -274,8 +275,7 @@ check_coding_spec(const char* line, Py_ssize_t size, struct tok_state *tok, tok->read_coding_spec = 1; if (tok->encoding == NULL) { assert(tok->decoding_state == STATE_RAW); - if (strcmp(cs, "utf-8") == 0 || - strcmp(cs, "iso-8859-1") == 0) { + if (strcmp(cs, "utf-8") == 0) { tok->encoding = cs; } else { r = set_readline(tok, cs); diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h index c45dea1..df9cbc7 100644 --- a/Parser/tokenizer.h +++ b/Parser/tokenizer.h @@ -49,14 +49,14 @@ struct tok_state { enum decoding_state decoding_state; int decoding_erred; /* whether erred in decoding */ int read_coding_spec; /* whether 'coding:...' has been read */ - char *encoding; + char *encoding; /* Source encoding. */ int cont_line; /* whether we are in a continuation line. */ const char* line_start; /* pointer to start of current line */ #ifndef PGEN PyObject *decoding_readline; /* codecs.open(...).readline */ PyObject *decoding_buffer; #endif - const char* enc; + const char* enc; /* Encoding for the current str. */ const char* str; }; |