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



136
137
138
139
140
141
142
143
144
# File 'lib/sup/util.rb', line 136

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