mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 20:34:52 +00:00
Merge pull request #3114 from techAPJ/patch-1
Simplify utf-8 conversion
This commit is contained in:
commit
0baee98ef7
@ -146,9 +146,7 @@ module Email
|
||||
return nil if object.nil?
|
||||
|
||||
if object.charset
|
||||
# convert UTF8 charset to UTF-8
|
||||
object.charset = object.charset.gsub(/utf8/i, "UTF-8") if object.charset.downcase == "utf8"
|
||||
object.body.decoded.force_encoding(object.charset).encode("UTF-8").to_s
|
||||
object.body.decoded.force_encoding(object.charset.gsub(/utf8/i, "UTF-8")).encode("UTF-8").to_s
|
||||
else
|
||||
object.body.to_s
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user