Skip to content

Commit

Permalink
ensure we operate on bytes in 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Apr 30, 2012
1 parent 271c484 commit 7efbfa6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/email_reply_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7efbfa6

Please sign in to comment.