* pack.c (pack_pack): templates a, A, Z should propagate encoding
of original strings. templates b, B, h, H brings ASCII-8BIT to the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
86c50e3983
commit
93fa4cbf3d
@ -6,6 +6,12 @@ Thu Oct 30 14:45:45 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
|
|||||||
* enc/trans/iso-8859-1-tbl.rb: new file to avoid having to
|
* enc/trans/iso-8859-1-tbl.rb: new file to avoid having to
|
||||||
treat ISO-8859-1 as special
|
treat ISO-8859-1 as special
|
||||||
|
|
||||||
|
Thu Oct 30 14:10:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* pack.c (pack_pack): templates a, A, Z should propagate encoding
|
||||||
|
of original strings. templates b, B, h, H brings ASCII-8BIT to
|
||||||
|
the result.
|
||||||
|
|
||||||
Thu Oct 30 10:34:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Oct 30 10:34:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ruby.c (moreswitches): splits option string and passes arguments.
|
* ruby.c (moreswitches): splits option string and passes arguments.
|
||||||
|
7
pack.c
7
pack.c
@ -519,8 +519,15 @@ pack_pack(VALUE ary, VALUE fmt)
|
|||||||
ptr = RSTRING_PTR(from);
|
ptr = RSTRING_PTR(from);
|
||||||
plen = RSTRING_LEN(from);
|
plen = RSTRING_LEN(from);
|
||||||
OBJ_INFECT(res, from);
|
OBJ_INFECT(res, from);
|
||||||
|
switch (type) {
|
||||||
|
case 'a': case 'A': case 'Z':
|
||||||
enc = rb_enc_compatible(res, from);
|
enc = rb_enc_compatible(res, from);
|
||||||
rb_enc_associate(res, enc);
|
rb_enc_associate(res, enc);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rb_enc_associate(res, rb_ascii8bit_encoding());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p[-1] == '*')
|
if (p[-1] == '*')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user