Rescue from CharlockHolmes failure
This commit is contained in:
parent
af99e4afe1
commit
b53df22127
|
@ -3,7 +3,7 @@ module Gitlabhq
|
||||||
extend self
|
extend self
|
||||||
|
|
||||||
def utf8 message
|
def utf8 message
|
||||||
hash = CharlockHolmes::EncodingDetector.detect(message)
|
hash = CharlockHolmes::EncodingDetector.detect(message) rescue {}
|
||||||
if hash[:encoding]
|
if hash[:encoding]
|
||||||
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
|
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue