ruby-changes:9531
From: yugui <ko1@a...>
Date: Fri, 26 Dec 2008 20:16:54 +0900 (JST)
Subject: [ruby-changes:9531] Ruby:r21071 (ruby_1_9_1): merges r20905 from trunk into ruby_1_9_1.
yugui 2008-12-26 20:16:23 +0900 (Fri, 26 Dec 2008) New Revision: 21071 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21071 Log: merges r20905 from trunk into ruby_1_9_1. * parse.y (gettable_gen): the encoding of __FILE__ should be rb_filesystem_encoding(). [ruby-list:45733] * parse.y (gettable_gen): __FILE__ should be ASCII-8BIT when filesystem encoding is US-ASCII and __FILE__ contains non 7bit characters. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/parse.y Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21070) +++ ruby_1_9_1/ChangeLog (revision 21071) @@ -1,3 +1,12 @@ +Mon Dec 22 09:54:43 2008 Yukihiro Matsumoto <matz@r...> + + * parse.y (gettable_gen): the encoding of __FILE__ should be + rb_filesystem_encoding(). [ruby-list:45733] + + * parse.y (gettable_gen): __FILE__ should be ASCII-8BIT when + filesystem encoding is US-ASCII and __FILE__ contains non 7bit + characters. + Fri Dec 26 15:50:45 2008 Nobuyoshi Nakada <nobu@r...> * lib/optparse.rb (OptionParser::List#summarize): gives priority Index: ruby_1_9_1/parse.y =================================================================== --- ruby_1_9_1/parse.y (revision 21070) +++ ruby_1_9_1/parse.y (revision 21071) @@ -7931,7 +7931,13 @@ return NEW_FALSE(); } else if (id == keyword__FILE__) { - return NEW_STR(STR_NEW2(ruby_sourcefile)); + 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); } else if (id == keyword__LINE__) { return NEW_LIT(INT2FIX(ruby_sourceline)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/