FIX: convert UTF8 charset to UTF-8

This commit is contained in:
Arpit Jalan 2015-01-19 09:29:47 +05:30
parent 4fd1fdeb01
commit fad9ca7b36
1 changed files with 2 additions and 0 deletions

View File

@ -146,6 +146,8 @@ module Email
return nil if object.nil? return nil if object.nil?
if object.charset 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).encode("UTF-8").to_s
else else
object.body.to_s object.body.to_s