Can Python fix vcard files?

Paul Boddie paul at boddie.org.uk
Wed Oct 15 15:09:24 CEST 2008


On 15 Okt, 06:40, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <1ddce4a8-e11c-4b06-9859-32d69407e... at r66g2000hsg.googlegroups.com>, Paul Boddie wrote:
> > I didn't find anything which forbids splitting quoted-printable
> > character values in these specifications.
>
> What adds to the confusion is that quoted-printable has its own convention
> for soft-wrapping long lines, using an equals sign followed by a newline.

I think the necessary approach involves interpreting data in the vCard
"content model" before interpreting data in the quoted-printable
"content model". That is, follow the vCard rules around line
formatting to first reconstruct encoded content, then do what you
would normally do with that encoded content. It's a bit like parsing
XML and then attempting to read text from the document's parsed
representation, rather than just matching a particular region with a
regular expression and finding that it yields "<" and ">"
instead of the expected "<" and ">".

Paul



More information about the Python-list mailing list