e$B0J2<$N$h$&$K!“e(BIconv::Failure#success e$B$NJV$jCM$Ne(B encoding
e$B$,e(B
ASCII-8BIT e$B$K$J$k$N$G$9$,!”[email protected]$7$?7k2L$J$N$G!"e(B
e$BJQ49@h$Ne(B encoding e$B$K$J$C$F$$$k$HNI$$$H;W$&$s$G$9$,$I$&$G$7$ge(B
e$B$&$+!#e(B
% ./ruby -v -riconv -e ’
s = “\xa1\xa1\xa1”.force_encoding(“euc-jp”)
ic = Iconv.new(“utf-8”, “euc-jp”)
begin
ic.iconv(s)
rescue Iconv::Failure
p $!.success.encoding
end
’
ruby 1.9.0 (2008-01-19 revision 0) [i686-linux]
#Encoding:ASCII-8BIT