[BUG:trunk] Encoding in which Array#pack returns when a string-related format and a byte seq format


#1

Yuguie$B$G$9!#e(B

e$B8=:_!"<!$N$h$&$K$J$j$^$9!#e(B
["\u3042", 1].pack(“A*s!”).encoding #=> #Encoding:UTF-8

e$B$7$+$7$J$,$i!“e(Bs!e$B$,@8@.$9$k$N$OK<AE*$K%P%$%J%j$G$”$C$F!"$3$N>l9ge(B
rb_enc_compatible(UTF-8, ASCII-8BIT)
e$B$GA4BN$Oe(BASCII-8BITe$B$K$J$k$Y$-$G$O$Je(B
e$B$$$G$7$g$&$+!#e(B

e$B:#$N$H$3$m$Oe(B

  • s!e$B$,@8@.$9$k$N$O%(%s%3!<%G%#%s%0$r;}$?$J$$e(B
    => e$B7k9gAj<j$,$$$l$P$=$l$K=>$&e(B
    => e$B$$$J$1$l$Pe(BASCII-8BIT
    e$B$H$$$&H=CG$N$h$&$K8+$($^$9!#e(B

e$B$7$+$7$J$,$i!"e(BAaMmUuxe$B$J$I$r=|$1$Pe(Bpacke$B$,@8@.$9$k$N$OJ8;zNs$H$$$&$h$j$O%Pe(B
e$B%$%HNs$G$9!#FC$K%W%i%C%H%U%)!<%`0MB8$Je(Bpack
formate$B$K$D$$$F$O$=$N?’:L$,G;e(B
e$B8|$G$9!#$3$l$i$O@Q6KE*$Ke(BASCII-8BITe$B$K79$1$k$Y$-$G$O$J$$$G$7$g$&$+!#e(B


#2

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37294] [BUG:trunk] Encoding in which
Array#pack returns when a string-related format and a byte seq format
are mixed”
on Sun, 7 Dec 2008 11:54:23 +0900, “Yugui (Yuki S.)”
removed_email_address@domain.invalid writes:

|e$B:#$N$H$3$m$Oe(B
|* s!e$B$,@8@.$9$k$N$O%(%s%3!<%G%#%s%0$r;}$?$J$$e(B
| => e$B7k9gAj<j$,$$$l$P$=$l$K=>$&e(B
| => e$B$$$J$1$l$Pe(BASCII-8BIT
|e$B$H$$$&H=CG$N$h$&$K8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$$H=CG$G$O$J$$$+$H;W$$$^$9!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

#3

e$B%A%1%C%He(B #832 e$B$,99?7$5$l$^$7$?!#e(B (by Yuki S.)

applied in r21074

http://redmine.ruby-lang.org/issues/show/832