[BUG:trunk] Encoding in which Array#pack returns when the last format is 'u', 'M', 'm'


#1

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

e$B$?$V$se(B[ruby-dev:37286]e$B$,$i$_$G$9$,!"%Q%C%/%U%)!<%^%C%H$N:G8e$Ke(B’u’,
‘M’,
'm’e$B$,$"$k$HLa$jCM$,LdEzL5MQ$Ge(BUS-ASCIIe$B$K$J$j$^$9!#e(B

str1 = “\xE0\xE1”.force_encoding(“iso-8859-1”)
str2 = “\u3042”.encode(“UTF-16BE”)
bin1 = “\xFF\xFe\x81\x82”

p [str1].pack(“A*”).encoding #=> #Encoding:ISO-8859-1
p [str2].pack(“A*”).encoding #=> #Encoding:UTF-16BE
p [str1, str2].pack(“AA”).encoding #=> #Encoding:ASCII_8BIT
p [str1, bin1].pack(“Am").encoding #=> #Encoding:US-ASCII
p [str2, bin1].pack("A
m”).encoding #=> #Encoding:US-ASCII
p [str1, str2, bin1].pack(“AAm”).encoding #=> #Encoding:US-ASCII


#2

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

In message “Re: [ruby-dev:37295] [BUG:trunk] Encoding in which
Array#pack returns when the last format is ‘u’, ‘M’, ‘m’”
on Sun, 7 Dec 2008 12:18:38 +0900, “Yugui (Yuki S.)”
removed_email_address@domain.invalid writes:

|e$B$?$V$se(B[ruby-dev:37286]e$B$,$i$_$G$9$,!"%Q%C%/%U%)!<%^%C%H$N:G8e$Ke(B’u’, ‘M’,
|'m’e$B$,$"$k$HLa$jCM$,LdEzL5MQ$Ge(BUS-ASCIIe$B$K$J$j$^$9!#e(B

e$B%P%0$G$9$M!#D>$7$F$*$-$^$9!#e(B


#3

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

e$B%P%0$G$9$M!#D>$7$F$*$-$^$9!#e(B

e$B$"!"D>$7$^$7$?!#e(B


#4

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

In message “Re: [ruby-dev:37324] Re: [BUG:trunk] Encoding in which
Array#pack returns when the last format is ‘u’, ‘M’, ‘m’”
on Tue, 9 Dec 2008 00:11:23 +0900, “Yugui (Yuki S.)”
removed_email_address@domain.invalid writes:

|Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:
|> e$B%P%0$G$9$M!#D>$7$F$*$-$^$9!#e(B
|
|e$B$"!"D>$7$^$7$?!#e(B

e$B;E;v$,Aa$$!#$"$j$,$H$&$4$6$$$^$9!#e(B


#5

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

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r20588.

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