Method: EncodingHelper#encode_utf8

Defined in:
lib/gitlab_git/encoding_helper.rb

#encode_utf8(message) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/gitlab_git/encoding_helper.rb', line 38

def encode_utf8(message)
  detect = CharlockHolmes::EncodingDetector.detect(message)
  if detect
    CharlockHolmes::Converter.convert(message, detect[:encoding], 'UTF-8')
  else
    clean(message)
  end
end