Rescue from CharlockHolmes failure

This commit is contained in:
Thomas A. de Ruiter 2012-04-24 12:41:20 +02:00
parent af99e4afe1
commit b53df22127

View file

@ -3,7 +3,7 @@ module Gitlabhq
extend self
def utf8 message
hash = CharlockHolmes::EncodingDetector.detect(message)
hash = CharlockHolmes::EncodingDetector.detect(message) rescue {}
if hash[:encoding]
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
else