# WORD.
end
- begin
- Iconv.easy_decode(target, charset, text)
- rescue Iconv::InvalidCharacter
- text
- end
+ Iconv.easy_decode(target, charset, text)
end
end
end
begin
Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2]
- rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e
+ rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::InvalidCharacter, Iconv::IllegalSequence => e
Redwood::log "warning: error (#{e.class.name}) decoding text from #{charset} to #{target}: #{text[0 ... 20]}"
text
end