From: Nobuyoshi Nakada Date: 2003-04-17T13:58:56+09:00 Subject: Re: ANN: RFC 2047 decoding library (MIME format for non-ascii in mail headers) Hi, At Thu, 17 Apr 2003 13:41:29 +0900, Sam Roberts wrote: > 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. -- Nobu Nakada