aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-06-08 10:18:26 +0000
committerJamis Buck <jamis@37signals.com>2005-06-08 10:18:26 +0000
commit29d6d15fc3dcb0d1c0ba531c5de7a8ea025f4ceb (patch)
tree4f2df38ae8d2bb9a9c64c850acede48b4b97f6e8 /actionmailer/lib
parentb0a35b6fe9c1a6a0eb14f2079a1bc8ff692ab621 (diff)
downloadrails-29d6d15fc3dcb0d1c0ba531c5de7a8ea025f4ceb.tar.gz
rails-29d6d15fc3dcb0d1c0ba531c5de7a8ea025f4ceb.tar.bz2
rails-29d6d15fc3dcb0d1c0ba531c5de7a8ea025f4ceb.zip
Silently ignore Errno::EINVAL errors when converting between charsets. Some mail clients apprently send X-UNKNOWN to represent unknown charsets, and this caused the conversion to blow up.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1395 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/vendor/tmail/quoting.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb
index 4420f2ea6b..b593efafcd 100644
--- a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb
+++ b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb
@@ -79,10 +79,13 @@ module TMail
def convert_to(text, to, from)
return text unless to && from
text ? Iconv.iconv(to, from, text).first : ""
- rescue Iconv::IllegalSequence
+ rescue Iconv::IllegalSequence, Errno::EINVAL
# the 'from' parameter specifies a charset other than what the text
# actually is...not much we can do in this case but just return the
# unconverted text.
+ #
+ # Ditto if either parameter represents an unknown charset, like
+ # X-UNKNOWN.
text
end
rescue LoadError