Class: RMail::Header::Field

Inherits:
Object show all
Defined in:
lib/sup/util.rb

Overview

Convert to ASCII before trying to match with regexp

Class Method Summary collapse

Class Method Details

.parse(field) ⇒ Object



127
128
129
130
131
132
133
134
135
# File 'lib/sup/util.rb', line 127

def parse(field)
  field = field.dup.to_s
  field = field.fix_encoding!.ascii
  if field =~ EXTRACT_FIELD_NAME_RE
    [ $1, $'.chomp ]
  else
    [ "", Field.value_strip(field) ]
  end
end