add a rexml encoding fallback
authorgc <gc>
Sat, 31 May 2008 22:44:25 +0000 (22:44 +0000)
committergc <gc>
Sat, 31 May 2008 22:44:25 +0000 (22:44 +0000)
lib/booh/booh-lib.rb

index b6b630a..c0d87fd 100644 (file)
@@ -43,6 +43,12 @@ end
 module Booh
     $verbose_level = 2
     $CURRENT_CHARSET = `locale charmap`.chomp
+    #- check charset availability. a locale configuration of C or POSIX yields the unsupported 'ANSI_X3.4-1968'.
+    begin
+        REXML::XMLDecl.new(REXML::XMLDecl::DEFAULT_VERSION, $CURRENT_CHARSET)
+    rescue
+        $CURRENT_CHARSET = 'UTF-8'
+    end
     $convert = 'convert -interlace line +profile "*"'
     $convert_enhance = '-contrast -enhance -normalize'