Subject: | Address (ADR) parsing |
Version 0.4 has:
# ADR
$ln =~ /^ADR;TYPE=([^:]+)?:([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?$/i;
push @{$vcard->{adr}} , {"type"=>$1,pobox=>$2,extadr=>$3,street=>$4,locality=>$4,region=>$5,pcode=>$6,country=>$7};
But rfc2526 states:
adr-value = 0*6(text-value ";") text-value
; PO Box, Extended Address, Street, Locality, Region, Postal
; Code, Country Name
So..
ADR;type=HOME;type=pref:;;45 The Road;London;;W4 2XY;England
Parses with the postcode (W4 2XY) being put into the country field,
I think Locality should be treated as Locality rather than Street:
# ADR
$ln =~ /^ADR;TYPE=([^:]+)?:([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?;([^;]+)?$/i;
push @{$vcard->{adr}} , {"type"=>$1,pobox=>$2,extadr=>$3,street=>$4,locality=>$5,region=>$6,pcode=>$7,country=>$8};
Obviously I may have missed something obvious!
Thanks
Leo