$NetBSD: patch-ab,v 1.1 2008/09/14 13:58:57 taca Exp $

--- raggle.orig	2005-12-15 07:54:11.000000000 +0900
+++ raggle
@@ -81,6 +81,7 @@ require 'pstore'
 require 'thread'
 require 'time'
 require 'uri'
+require 'rubygems' if RUBY_VERSION.sub(/\.\d+$/, "") < "1.9"
 
 #########################
 # load external modules #
@@ -132,7 +133,7 @@ if $HAVE_LIB['gettext']
   GetText::bindtextdomain('raggle', nil)
 end
 
-unless $HAVE_LIB['webrick'] || $HAVE_LIB['ncurses']
+unless $HAVE_LIB['webrick'] and $HAVE_LIB['ncurses']
   $stderr.puts _(<<-ENDERR
 ERROR: No interfaces available.
 You're missing the both the Ncurses-Ruby and WEBrick modules.  You need
@@ -1813,8 +1814,15 @@ ENDWARNING
         if $HAVE_LIB['iconv'] && $config['use_iconv']
           unless $iconv
             # $iconv hasn't been intialized; create it
-            enc += '//TRANSLIT' if $config['use_iconv_translit']
-            $iconv = Iconv.new(enc, 'UTF-8')
+            if $config['use_iconv_translit']
+              begin
+                $iconv = Iconv.new(enc + '//TRANSLIT', 'UTF-8')
+              rescue Iconv::InvalidEncoding
+                $iconv = Iconv.new(enc, 'UTF-8')
+              end
+            else
+              $iconv = Iconv.new(enc, 'UTF-8')
+            end
           end
 
           # decode element using iconv
