Commit e851cb07762aa464aae10e8b4b28de87c1a6f925
1 parent
c62715ac
Exists in
master
and in
4 other branches
must force_encoding to utf-8 first
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/gitlab/encode.rb
... | ... | @@ -8,12 +8,12 @@ module Gitlab |
8 | 8 | # return nil if message is nil |
9 | 9 | return nil unless message |
10 | 10 | |
11 | + message.force_encoding("utf-8") | |
11 | 12 | # return message if message type is binary |
12 | 13 | detect = CharlockHolmes::EncodingDetector.detect(message) |
13 | 14 | return message if detect[:type] == :binary |
14 | 15 | |
15 | 16 | # if message is utf-8 encoding, just return it |
16 | - message.force_encoding("utf-8") | |
17 | 17 | return message if message.valid_encoding? |
18 | 18 | |
19 | 19 | # if message is not utf-8 encoding, convert it | ... | ... |