[maemo-developers] Related to Contacts : Decoding .VCF File

From: Jörgen Scheibengruber jorgen.scheibengruber at nokia.com
Date: Fri Jul 2 12:20:24 EEST 2010
Am Freitag, den 02.07.2010, 06:35 +0200 schrieb ext sandeep kodimela:

> Hi Thanks for the reply,The method you suggested is to create a new
> Evcard 
> object from the string.But I already have the .VCF file,Which was
> generated when 
> I exported the contacts to some new older(for back-up).
> My intention is to bring the raw .VCF file to a EContact form.

Which is exactly what e_contact_new_from_vcard, does. It's as easy as:

char *contents;
if (g_file_get_contents ("file.vcf", &contents, NULL, NULL)) {
	EContact *contact;
	contact = e_contact_new_from_vcard (contents);
	g_free (contents).
}

HTH,
Jörgen

More information about the maemo-developers mailing list