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 b6b630a0de168ca7e2072f32cdfa7c193aaccb8d..c0d87fdf11ba1886e17c99ae7adcb74e1db3dce6 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'