[Bug:1.9] GzipReader with iso-2022-jp to euc-jp and gets(euc-jp-record-separator)


#1

Zlib::GzipReader e$B$Ne(B gets e$B$N5sF0$,e(B IO
e$B$H0J2<$N$h$&$K0[$J$j$^$9!#e(B

“e$B$”$$$&e(B" e$B$H$$$&e(B EUC-JP e$B$NJ8;zNs$re(B gzip
e$B$7$?F~NO$KBP$7!"e(B
Zlib::GzipReader#gets(“e$B$$e(B”) e$B$H$7$F$be(B “e$B$$e(B” e$B$Ge(B
gets e$B$,=*$o$j$^$;$s!#e(B

% echo e$B$"$$$&e(B|nkf|gzip -c|./ruby -rzlib -e ’
z = Zlib::GzipReader.new(STDIN,
:external_encoding => “iso-2022-jp”,
:internal_encoding => “euc-jp”)
p z.gets("\xa4\xa4".force_encoding(“euc-jp”))

“e$B$”$$$&e(B\n"

IO#gets e$B$G$O=*$o$j$^$9!#e(B

% echo e$B$"$$$&e(B|nkf|./ruby -e ’
f = open("/dev/stdin",
:external_encoding => “iso-2022-jp”,
:internal_encoding => “euc-jp”)
p f.gets("\xa4\xa4".force_encoding(“euc-jp”))

“e$B$”$$e(B"