[Vobject] saving unicode vcard

Anil replicase at gmail.com
Sat May 31 15:12:16 CDT 2008


I am reading some data from a database in UTF8. I convert the data
into unicode. I want to save it to a vcard file. Should this data be
written as Unicode or UTF8?

I am doing something like this now:

            f = codecs.open(fname, "w", 'utf-8')
            f.write(j.serialize().decode('utf-8'))
            f.close()

But in the end, the file inside has escaped-strings (as per VI). Is
that unicode?

I import this new file back into database as UTF (I do a encode), but
when my app reads the data back, I get some gibbirish. The umlauts
don't show up properly.

What am I doing wrong? Should the file contain Unicode data or UTF data?

See attachment in this email - thats the file that got written.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Q0VAcm.vcf
Type: text/x-vcard
Size: 128 bytes
Desc: not available
Url : http://lists.skyhouseconsulting.com/pipermail/vobject/attachments/20080531/bfa74231/attachment.vcf 


More information about the VObject mailing list