Browse files

ensure we operate on bytes in 1.9

  • Loading branch information...
1 parent 271c484 commit 7efbfa631848feccd741ed991400d36ceb87d16f @brianmario brianmario committed Apr 30, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/email_reply_parser.rb
View
3 lib/email_reply_parser.rb
@@ -76,6 +76,9 @@ def visible_text
#
# Returns this same Email instance.
def read(text)
+ # in 1.9 we want to operate on the raw bytes
+ text = text.dup.force_encoding('binary') if text.respond_to?(:force_encoding)
+
# Check for multi-line reply headers. Some clients break up
# the "On DATE, NAME <EMAIL> wrote:" line into multiple lines.
if text =~ /^(On(.+)wrote:)$/nm

0 comments on commit 7efbfa6

Please sign in to comment.