Hi,

At Thu, 11 Oct 2007 02:20:11 +0900,
Eugene Ossintsev wrote in [ruby-core:12579]:
> I noticed Ruby 1.9 had the class Iconv improved. In 1.9 it became
> possible to discard characters that cannot be converted from one
> encoding to another for some reason. So, it's like in GNU iconv
> utility with the option '-c' as I understand. It's much better than in
> 1.8 where it is aborted with an exception in such a case.

> By the way, are there any plans to augment exception handling so that
> it would be possible to handle illegal characters even more flexible,
> say, not discarding them but replacing with some character or giving
> more information on where it stopped or something?

Once I thought to use a block for exception handling.

e.g.
  Iconv.open("utf-8", "euc-jp") {|cd|
    cd.iconv("\xa1\xa2") {|errinfo| ...}
  }

or,

  Iconv.open("utf-8", "euc-jp", Iconv::IllegalSequence => proc {|errinfo| ...}) {
    ...
  }

Any thoughts?

-- 
Nobu Nakada