Method: Vcard.decode_text

Defined in:
lib/vcard.rb

.decode_text(v) ⇒ Object

Convert RFC 2425 text into a String. \ -> \ n -> NL N -> NL , -> , ; -> ;

I’ve seen double-quote escaped by iCal.app. Hmm. Ok, if you aren’t supposed to escape anything but the above, everything else is ambiguous, so I’ll just support it.



178
179
180
181
182
183
184
185
186
187
188
# File 'lib/vcard.rb', line 178

def self.decode_text(v) # :nodoc:
  # FIXME - I think this should trim leading and trailing space
  v.gsub(/\\(.)/) do
    case $1
    when "n", "N"
      "\n"
    else
      $1
    end
  end
end