From fad9ca7b3645f454bd48eb9a40c6a85f84ce1ca4 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 19 Jan 2015 09:29:47 +0530 Subject: [PATCH] FIX: convert UTF8 charset to UTF-8 --- lib/email/receiver.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index 8c9e7bec893..44857065e3b 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -146,6 +146,8 @@ 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 else object.body.to_s