Removed encoding monkey patch
This commit is contained in:
parent
52f6df7255
commit
b7558a2063
6 changed files with 46 additions and 45 deletions
14
lib/gitlabhq/encode.rb
Normal file
14
lib/gitlabhq/encode.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
module Gitlabhq
|
||||
module Encode
|
||||
extend self
|
||||
|
||||
def utf8 message
|
||||
hash = CharlockHolmes::EncodingDetector.detect(message)
|
||||
if hash[:encoding]
|
||||
CharlockHolmes::Converter.convert(message, hash[:encoding], 'UTF-8')
|
||||
else
|
||||
message
|
||||
end.force_encoding("utf-8")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue