ruby-changes:9131
From: yugui <ko1@a...>
Date: Fri, 12 Dec 2008 23:53:31 +0900 (JST)
Subject: [ruby-changes:9131] Ruby:r20668 (ruby_1_9_1): merges r20563 and r20588 from trunk into ruby_1_9_1.
yugui 2008-12-12 23:53:00 +0900 (Fri, 12 Dec 2008) New Revision: 20668 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20668 Log: merges r20563 and r20588 from trunk into ruby_1_9_1. * pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT when quoted-printable ('M') and base64 ('m'). [ruby-dev:37284] * pack.c (pack_unpack): ditto. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/pack.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20667) +++ ruby_1_9_1/ChangeLog (revision 20668) @@ -1,3 +1,17 @@ +Tue Dec 9 11:50:46 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * pack.c (pack_pck): fixed [ruby-dev:37295]. + Array#pack always has returned an US-ASCII string when + the given format ended with 'u', 'M' or 'm'. + +Sat Dec 6 14:35:06 2008 NARUSE, Yui <naruse@r...> + + * pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT + when quoted-printable ('M') and base64 ('m'). + [ruby-dev:37284] + + * pack.c (pack_unpack): ditto. + Thu Dec 11 11:51:36 2008 Nobuyoshi Nakada <nobu@r...> * encoding.c (rb_locale_encoding): removed Encoding::LOCALE. Index: ruby_1_9_1/pack.c =================================================================== --- ruby_1_9_1/pack.c (revision 20667) +++ ruby_1_9_1/pack.c (revision 20668) @@ -896,6 +896,8 @@ case 'u': /* uuencoded string */ case 'm': /* base64 encoded string */ + enc = rb_enc_compatible(res, rb_enc_from_encoding(rb_usascii_encoding())); + rb_enc_associate(res, enc); from = NEXTFROM; StringValue(from); ptr = RSTRING_PTR(from); @@ -924,6 +926,8 @@ break; case 'M': /* quoted-printable encoded string */ + enc = rb_enc_compatible(res, rb_enc_from_encoding(rb_usascii_encoding())); + rb_enc_associate(res, enc); from = rb_obj_as_string(NEXTFROM); if (len <= 1) len = 72; @@ -1886,6 +1890,7 @@ } } rb_str_set_len(buf, ptr - RSTRING_PTR(buf)); + ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT); UNPACK_PUSH(buf); } break; @@ -1914,6 +1919,7 @@ s++; } rb_str_set_len(buf, ptr - RSTRING_PTR(buf)); + ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT); UNPACK_PUSH(buf); } break; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/