diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-23 15:13:18 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-23 15:13:18 +0000 |
| commit | 1fca0d5ddda6ad52618012f80b0aa0bd39763111 (patch) | |
| tree | 993e53b0ea1632cee2d14158e6b7d3e919643432 /parse.y | |
| parent | 4973c1e41c09d5110cceaa08006f1abd1109ce67 (diff) | |
| download | ruby-1fca0d5ddda6ad52618012f80b0aa0bd39763111.tar.gz ruby-1fca0d5ddda6ad52618012f80b0aa0bd39763111.tar.xz ruby-1fca0d5ddda6ad52618012f80b0aa0bd39763111.zip | |
* string.c (rb_external_str_new_with_enc): set ASCII-8BIT if
encoding is US-ASCII and string contains 8bit characters.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -7923,13 +7923,8 @@ gettable_gen(struct parser_params *parser, ID id) return NEW_FALSE(); } else if (id == keyword__FILE__) { - VALUE str = rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile), - rb_filesystem_encoding()); - if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT && - ENCODING_GET(str) == rb_usascii_encindex()) { - rb_enc_associate(str, rb_ascii8bit_encoding()); - } - return NEW_STR(str); + return NEW_STR(rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile), + rb_filesystem_encoding())); } else if (id == keyword__LINE__) { return NEW_LIT(INT2FIX(ruby_sourceline)); |
