@@ -76,15 +76,14 @@ def visible_text
7676 #
7777 # Returns this same Email instance.
7878 def read ( text )
79- # in 1.9 we want to operate on the raw bytes
80- text = text . dup . force_encoding ( 'binary' ) if text . respond_to? ( :force_encoding )
79+ text = text . dup
8180
8281 # Normalize line endings.
8382 text . gsub! ( "\r \n " , "\n " )
8483
8584 # Check for multi-line reply headers. Some clients break up
8685 # the "On DATE, NAME <EMAIL> wrote:" line into multiple lines.
87- if text =~ /^(?!On.*On\s .+?wrote:)(On\s (.+?)wrote:)$/nm
86+ if text =~ /^(?!On.*On\s .+?wrote:)(On\s (.+?)wrote:)$/m
8887 # Remove all new lines from the reply header.
8988 text . gsub! $1, $1. gsub ( "\n " , " " )
9089 end
@@ -110,7 +109,7 @@ def read(text)
110109
111110 # Use the StringScanner to pull out each line of the email content.
112111 @scanner = StringScanner . new ( text )
113- while line = @scanner . scan_until ( /\n /n )
112+ while line = @scanner . scan_until ( /\n / )
114113 scan_line ( line )
115114 end
116115
@@ -156,7 +155,7 @@ def scan_line(line)
156155
157156 # We're looking for leading `>`'s to see if this line is part of a
158157 # quoted Fragment.
159- is_quoted = !!( line =~ /(>+)$/n )
158+ is_quoted = !!( line =~ /(>+)$/ )
160159
161160 # Mark the current Fragment as a signature if the current line is empty
162161 # and the Fragment starts with a common signature indicator.
@@ -189,7 +188,7 @@ def scan_line(line)
189188 #
190189 # Returns true if the line is a valid header, or false.
191190 def quote_header? ( line )
192- line =~ /^:etorw.*nO$/n
191+ line =~ /^:etorw.*nO$/
193192 end
194193
195194 # Builds the fragment string and reverses it, after all lines have been
0 commit comments