[ruby/prism] Fix eval encoding switching to UTF-8
https://github.com/ruby/prism/commit/24e3ff5d6d
This commit is contained in:
parent
835fa98a62
commit
20f03100d5
@ -6605,12 +6605,9 @@ parser_lex_magic_comment_encoding_value(pm_parser_t *parser, const uint8_t *star
|
|||||||
const pm_encoding_t *encoding = pm_encoding_find(start, end);
|
const pm_encoding_t *encoding = pm_encoding_find(start, end);
|
||||||
|
|
||||||
if (encoding != NULL) {
|
if (encoding != NULL) {
|
||||||
if (encoding != PM_ENCODING_UTF_8_ENTRY) {
|
parser->encoding = encoding;
|
||||||
parser->encoding = encoding;
|
parser->encoding_changed = (encoding != PM_ENCODING_UTF_8_ENTRY);
|
||||||
parser->encoding_changed = true;
|
if (parser->encoding_changed_callback != NULL) parser->encoding_changed_callback(parser);
|
||||||
if (parser->encoding_changed_callback != NULL) parser->encoding_changed_callback(parser);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user