Login   Register  
PHP Classes
elePHPant
Icontem

vCard fixes

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      IMC Objects 2  >  All threads  >  vCard fixes  >  (Un) Subscribe thread alerts  
Subject:vCard fixes
Summary:lowercase VCF files and quoted-printable encoding
Messages:4
Author:Vlad
Date:2013-08-06 16:06:36
Update:2013-08-21 14:36:29
 

  1. vCard fixes   Reply   Report abuse  
Picture of Vlad
Vlad
2013-08-06 16:06:36
Many vcf files use lowercase property names and this class fails to parse them. The variable "$left" needs to be forced to uppercase inside "ComponentSet::read_self".
Also support for "QUOTED-PRINTABLE" encoding is missing, but ease to add under "imcProperty.php". I can share my customized code if anybody wishes (i'm not familiar with this site and don't know how to contribute).
Otherwise, thanks a lot for this class, it is very useful.

Best regards,

Vlad

  2. Re: vCard fixes   Reply   Report abuse  
Picture of CPK Smithies
CPK Smithies
2013-08-07 22:05:49 - In reply to message 1 from Vlad
Thanks for prompting me to check the RFCs. In fact property names are supposed to be case-insensitive. I don't like making $left upper case in ComponentSet::read_self() as this will also affect the case of parameter values, which might lead to unintended consequences. I have therefore forced $PropName upper case in Property::factory() instead.

As for quoted-printable encoding, this is not mentioned in the standards specifications (that I've read). I'd be grateful for an example where it is used, so I can see how it is named in the ENCODING parameter value. Meanwhile I have I hope provided basic support, although I'm somewhat working in the dark.

I hope to upload new versions of imcComponent.php and imcProperty.php shortly.

  3. Re: vCard fixes   Reply   Report abuse  
Picture of Vlad
Vlad
2013-08-08 09:08:26 - In reply to message 2 from CPK Smithies
Thanks for the quick reply. You know the code better, my uppercase suggestion was just a quick workaround for everybody else.
I don't have experience with vCards but when I started working with them, it just happened that the first test vCard I used was using the QP encoding. Here's a test vCard (with both lowercase props and the encoding):

begin:vcard
fn;quoted-printable:domain.tld=C2=AE John Doe
n;quoted-printable:John Doe;domain.tld=C2=AE
org;quoted-printable:domain.tld=C2=AE
email;internet:john@domain.tld
tel;work:+123 123 123 123
tel;cell:+123 123 123 123
url:domain.tld
version:2.1
end:vcard

On the Wikipedia page, the v2.1 example also includes this encoding, in a slightly different form: http://en.wikipedia.org/wiki/VCard#vCard_2.1

  4. Re: vCard fixes   Reply   Report abuse  
Picture of CPK Smithies
CPK Smithies
2013-08-21 14:36:29 - In reply to message 3 from Vlad
Thank you for that example. I was able to use it to correct a number of problems, and I hope that with the latest fixes you will now find everything working OK.