summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 03:18:19 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 03:18:19 +0000
commit60d976b3ddbbb77f378c34f6633efb2cf4331d15 (patch)
treebe5d1f8a977473a37fb2bee8a16b7b4a58e55b67 /pack.c
parent72b489a5ad8033dd1c70784bb40e7419e1380a31 (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
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pack.c b/pack.c
index d659266a41..7366b765a7 100644
--- a/pack.c
+++ b/pack.c
@@ -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;