From c9aaad795dbeaa9133a14b0d40fb0683cad30a2f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 3 Apr 2008 17:27:55 +0000 Subject: [PATCH] Ruby 1.9 compat: ascii encoding for quoted-printable regexps git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9217 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/quoting.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actionmailer/lib/action_mailer/quoting.rb b/actionmailer/lib/action_mailer/quoting.rb index d6e04e4d83..b222432787 100644 --- a/actionmailer/lib/action_mailer/quoting.rb +++ b/actionmailer/lib/action_mailer/quoting.rb @@ -24,6 +24,8 @@ module ActionMailer # Quote the given text if it contains any "illegal" characters def quote_if_necessary(text, charset) + text = text.dup.force_encoding(Encoding::ASCII_8BIT) if text.respond_to?(:force_encoding) + (text =~ CHARS_NEEDING_QUOTING) ? quoted_printable(text, charset) : text