From: Dave Burt Date: 2005-12-14T14:42:39+09:00 Subject: Re: Iconv weirdness on Windows XP I wrote just before: > My best guess is that it's an incompatibility problem between One-Click's > ruby core and iconv.so from the ruby-mswin32 package. OK, so Nobu's confirmed this. (Thanks, Nobu.) Meanwhile: > It shouldn't be Iconv::IllegalSequence - that's a "bad character" in the > "from" string. There's an exception defined in the library, > Iconv::InvalidEncoding - that makes sense, but apparently isn't used here. > The solution may be to use that instead of Errno. > > I haven't seen Errno::EINVAL thrown by iconv, although that's what > ruby-mswin32-1.8.2 does in this situation. And it doesn't crash. ruby-mswin32 1.8.4 preview 1 actually throws InvalidEncoding in this case, and this version of iconv.so doesn't demonstrate this crashing bug with One-Click Installer 1.8.2-15 (which I assume we're all using). Should I update my Iconv for One-Click package to use this new version? I'm concerned about potential incompatibility issues between it and Ruby 1.8.2. In any case, you can get this version of iconv.so from in this zip: ftp://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.4-preview1-i386-mswin32.zip > Wilson Bilkovich wrote: >> Specifically, the code that freaks out is: >> def convert_to(text, to, from) >> ... >> rescue Iconv::IllegalSequence, Errno::EINVAL So this test fixture is still going to fail. It will need to be updated like so: -rescue Iconv::IllegalSequence, Errno::EINVAL +rescue Iconv::IllegalSequence, Iconv::InvalidEncoding Cheers, Dave