# File raggle, line 1533 def fix_character_encoding(element) # get character encoding enc = $config['character_encoding'] || 'ISO-8859-1' # check and see if we have iconv support 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') end # decode element using iconv ret = $iconv.iconv(element.text.to_s) << $iconv.iconv(nil) else # iconv isn't installed, or it's disabled; fall back to # the old (oogly) encoding behavior ret = (REXML::Output.new('', enc) << element.text).to_s end # return result ret.unescape_html end