Merge pull request #704 from tader/workaround-charlock-holmes
Rescue from CharlockHolmes failures.
This commit is contained in:
commit
bbb93de17f
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue