diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-31 03:18:19 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-31 03:18:19 +0000 |
commit | 60d976b3ddbbb77f378c34f6633efb2cf4331d15 (patch) | |
tree | be5d1f8a977473a37fb2bee8a16b7b4a58e55b67 | |
parent | 72b489a5ad8033dd1c70784bb40e7419e1380a31 (diff) |
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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pack.c | 2 | ||||
-rw-r--r-- | test/ruby/test_pack.rb | 2 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Jan 14 14:01:12 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@gmail.com> * io.c (pipe_open): Added rb_thread_atfork(). We must reinitialize @@ -1978,7 +1978,7 @@ pack_unpack(VALUE str, VALUE fmt) 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; diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 8fa0a90915..77078d5cac 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -555,6 +555,8 @@ class TestPack < Test::Unit::TestCase 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 @@ -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 |