Skip to content

Commit

Permalink
Force encoding on Regexp for Ruby 1.9 to avoid encoding conflicts - G…
Browse files Browse the repository at this point in the history
…olubev Pavel
  • Loading branch information
mikel committed Sep 11, 2010
1 parent 550a18e commit b1eb87d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mail/patterns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module Patterns
lwsp = %Q| \t\r\n|
control = %Q|\x00-\x1f\x7f-\xff|

if control.respond_to?(:force_encoding)
control = control.force_encoding(Encoding::BINARY)
end

CRLF = /\r\n/
WSP = /[#{white_space}]/
FWS = /#{CRLF}#{WSP}*/
Expand Down

0 comments on commit b1eb87d

Please sign in to comment.