ruby-changes:19807
From: yugui <ko1@a...>
Date: Tue, 31 May 2011 12:22:48 +0900 (JST)
Subject: [ruby-changes:19807] yugui:r31852 (ruby_1_9_2): merges r30542 from trunk into ruby_1_9_2. Fixes #4279.
yugui 2011-05-31 12:18:19 +0900 (Tue, 31 May 2011) New Revision: 31852 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31852 Log: merges r30542 from trunk into ruby_1_9_2. Fixes #4279. -- * pack.c (pack_unpack): the resulted string of unpack('M') must have ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/pack.c branches/ruby_1_9_2/test/ruby/test_pack.rb branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 31851) +++ ruby_1_9_2/ChangeLog (revision 31852) @@ -1,3 +1,8 @@ +Fri Jan 14 14:01:12 2011 NARUSE, Yui <naruse@r...> + + * pack.c (pack_unpack): the resulted string of unpack('M') must have + ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482] + Sat Dec 25 20:01:40 2010 KOSAKI Motohiro <kosaki.motohiro@g...> * io.c (pipe_open): Added rb_thread_atfork(). We must reinitialize Index: ruby_1_9_2/pack.c =================================================================== --- ruby_1_9_2/pack.c (revision 31851) +++ ruby_1_9_2/pack.c (revision 31852) @@ -1978,7 +1978,7 @@ s++; } rb_str_set_len(buf, ptr - RSTRING_PTR(buf)); - ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT); + ENCODING_CODERANGE_SET(buf, rb_ascii8bit_encindex(), ENC_CODERANGE_VALID); UNPACK_PUSH(buf); } break; Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 31851) +++ ruby_1_9_2/version.h (revision 31852) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 267 +#define RUBY_PATCHLEVEL 268 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_2/test/ruby/test_pack.rb =================================================================== --- ruby_1_9_2/test/ruby/test_pack.rb (revision 31851) +++ ruby_1_9_2/test/ruby/test_pack.rb (revision 31852) @@ -555,6 +555,8 @@ assert_equal(["\x0a"], "=0A=\n".unpack("M")) assert_equal([""], "=0Z=\n".unpack("M")) assert_equal([""], "=\r\n".unpack("M")) + assert_equal([""], "=\r\n".unpack("M")) + assert_equal(["\xC6\xF7"], "=C6=F7".unpack('M*')) end def test_pack_unpack_P2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/