Hi,
The decoder is correctly pulling the base64 out of your example, it is
then decoding it to binary, correctly I assume, unless there is a bug
in ruby b64 code :-). However, Iconv.iconv() is dropping some of the
trailing bytes when converting from what is (claimed to be) iso-2022-jp
to is-2022-jp. Any idea what those characters are? Some sort of terminal
reset sequence, perhaps? Maybe iso-2022-jp is stateful, in some way?
Yes, iso-2022-jp is stateful. So you have to use Iconv.close
and append the result at the end of conversion.
GyRCJEgbKEIgGyRCJFIkaSQsJEobKEI= (b64)
“\e$B$H\e(B \e$B$R$i$,$J\e(B” (binary, iso-2022-jp)
“\e$B$H\e(B \e$B$R$i$,$J” (Iconv.iconv from iso-2022-jp to iso-2022-jp)
Iconv.close should return “\e(B” here.
···
At Thu, 17 Apr 2003 13:41:29 +0900, Sam Roberts wrote:
–
Nobu Nakada