Some time vcard may have 'ENCODING=QUOTED-PRINTABLE:' and lines look like
LABEL;TYPE=WORK;ENCODING=QUOTED-PRINTABLE:123 Privet Drive SE=0D=0A= City Province ZIP=0D=0A= Country=0D=0A=Vpim.unfold does not unfold it properly, and parser raises an exception Vpim::InvalidEncodingError: City Province ZIP=0D=0A= Current solution is to monkey patch Vpim.unfold
module Vpim
def self.unfold(card)
unfolded = []
card.each do |line|
line.chomp!
# If it's a continuation line, add it to the last.
# If it's an empty line, drop it from the input.
if( line =~ /^[ \t]/ )
unfolded[-1] << line[1, line.size-1]
elsif (unfolded.last && unfolded.last =~ /;ENCODING=QUOTED-PRINTABLE:.*?=0D=0A=$/)
unfolded.last << line
elsif( line =~ /^$/ )
else
unfolded << line
end
end
unfolded
end
end