summaryrefslogtreecommitdiff
path: root/lib/feed2imap/itemtomail.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feed2imap/itemtomail.rb')
-rw-r--r--lib/feed2imap/itemtomail.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 3a552d6..755a436 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -31,11 +31,16 @@ require 'feed2imap/rubymail_patch'
class String
def needMIME
utf8 = false
- self.unpack('U*').each do |c|
- if c > 127
- utf8 = true
- break
+ begin
+ self.unpack('U*').each do |c|
+ if c > 127
+ utf8 = true
+ break
+ end
end
+ rescue
+ # safe fallback in case of problems
+ utf8 = true
end
utf8
end