Removed encoding monkey patch

This commit is contained in:
Dmitriy Zaporozhets 2012-04-11 23:03:56 +03:00
parent 52f6df7255
commit b7558a2063
6 changed files with 46 additions and 45 deletions

14
lib/gitlabhq/encode.rb Normal file
View 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