开发者

vCard Parsing different parameters

开发者 https://www.devze.com 2023-02-27 14:51 出处:网络
I need to write a vCard Parser. Now the problem is th开发者_StackOverflow中文版at the Vcard I get can have n number of paramenters

I need to write a vCard Parser. Now the problem is th开发者_StackOverflow中文版at the Vcard I get can have n number of paramenters Like say TEL;CELL:123 or TEL;CELL;VOICE:123 or TEL:HOME;CELL;VOICE:123 now how i get this format really depends on my sources(which can be diverse and many). Now I need to make a generic reader which can identify tht all these different set of parameters can map to a single field(in this case Mobile number), but the way of sending this information varies across all sources(google, MS, Nokia). can someone please give any suggestion on how to handle such situation


vCard is a bloody mess to parse, especially since almost nothing out there produces RFC 2426-compliant output. For similar reasons I ended up writing a vCard parser / validator which you can use to massage the data into compliance. I use it daily to keep my own vCards (a few hundred people/companies) compliant, and the result has for example been that Gmail now imports all of them properly, address, phones, images and all.

0

精彩评论

暂无评论...
验证码 换一张
取 消