mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: force_encoding
* parse.y (str_suffix_gen): String#b creates new string object, use force_encoding instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a056098cb7
commit
93ea04ecec
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Sep 2 17:53:33 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (str_suffix_gen): String#b creates new string object, use
|
||||||
|
force_encoding instead.
|
||||||
|
|
||||||
Mon Sep 2 16:06:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
Mon Sep 2 16:06:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||||
|
|
||||||
* NEWS: Add note about frozen string literals
|
* NEWS: Add note about frozen string literals
|
||||||
|
|
4
parse.y
4
parse.y
|
@ -8576,7 +8576,9 @@ str_suffix_gen(struct parser_params *parser, NODE *node, long opt)
|
||||||
else {
|
else {
|
||||||
#if STR_OPTION_BINARY
|
#if STR_OPTION_BINARY
|
||||||
if (opt & STR_OPTION_BINARY) {
|
if (opt & STR_OPTION_BINARY) {
|
||||||
node = NEW_CALL(node, rb_intern("b"), 0);
|
VALUE ascii8bit = rb_enc_from_encoding(rb_ascii8bit_encoding());
|
||||||
|
NODE *args = NEW_LIST(NEW_LIT(ascii8bit));
|
||||||
|
node = NEW_CALL(node, rb_intern("force_encoding"), args);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if STR_OPTION_FROZEN
|
#if STR_OPTION_FROZEN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue