From: Toshi MARUYAMA Date: Wed, 8 Oct 2014 14:59:21 +0000 (+0000) Subject: MailHandler: Don't use String#respond_to?(:force_encoding) (#18047) X-Git-Tag: 2.6.0~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ac8507b3b3bde43f62bd25f3c86160cce09ac0f;p=redmine.git MailHandler: Don't use String#respond_to?(:force_encoding) (#18047) Contributed by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@13432 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index dab7a1a82..2687e8e1e 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -421,7 +421,7 @@ class MailHandler < ActionMailer::Base end @plain_text_body = parts.map do |p| - body_charset = p.charset.respond_to?(:force_encoding) ? + body_charset = Mail::RubyVer.respond_to?(:pick_encoding) ? Mail::RubyVer.pick_encoding(p.charset).to_s : p.charset Redmine::CodesetUtil.to_utf8(p.body.decoded, body_charset) end.join("\r\n")