From: Dave Burt Date: 2005-12-14T14:22:40+09:00 Subject: Re: Iconv weirdness on Windows XP Wilson Bilkovich wrote: On 12/13/05, Dave Burt wrote: > When I switch 'X-UNKNOWN' to 'char' in the test fixture, everything works > fine. Cool. > Specifically, the code that freaks out is: > def convert_to(text, to, from) > ... > rescue Iconv::IllegalSequence, Errno::EINVAL > ... > Given that, it looks like you're right about the library not setting > the proper error environment, because the method that invokes it is > expecting it to throw an error. > Oddly, though, ENOENT isn't on the list of exceptions to rescue there. > Adding it to the list doesn't stop the crash bug, unfortunately. 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. So you've uncovered a bug in my iconv package for the One-Click Installer. My best guess is that it's an incompatibility problem between One-Click's ruby core and iconv.so from the ruby-mswin32 package. > I tried putting config.charset in both c:/windows/system32, and in > c:/ruby/lib/ruby/1.8/i386-mswin32 (where iconv.so goes), to no avail. Nobu's post seemed to indicate the aliases file wasn't going to work on Windows. It may need an option compiled in to the binary or something. I don't know. Cheers, Dave