8f2a05cde6b642971bac777b30d7b881b4fd6c0f
Bring the remaining vCard 3 REV and KEY behavior into line with RFC 2426. For REV, serialize VALUE=date using the date form instead of incorrectly emitting VALUE=date-time with a timestamp payload. For KEY, stop defaulting constructed values to VALUE=uri. The vCard 3 specification defines KEY as binary by default and allows it to be reset to text, but not to uri. Tighten both construction and parsing accordingly: reject VALUE=uri for KEY, enforce the relationship between VALUE=binary and ENCODING=b, and reject VALUE=text when ENCODING=b is present. Update the regression coverage to reflect the spec boundary: PHOTO, LOGO, and SOUND may round-trip as uris; KEY may contain text that looks like a URI; KEY does not allow VALUE=uri; and vCard 3 KEY parameters still require name=value syntax. AI-Assisted: yes AI-Tool: OpenAI Codex / gpt-5.4 xhigh
VCard
nim-vcard is a pure nim implementation of the VCard format defined in RFCs
2425, 2426, and 6350. It allows you to parse and serialize VCards, as well as
create VCards programmatically. It aims to be a complete implememtation,
supporting all of the features of the VCard3 standard. Because the standard
provides many features that may be rarely used, this library also provides a
simplified API for more typical use-cases.
Example Usage
BEGIN:VCARD
VERSION:3.0
UID: 5db6f100-e2d6-4e8d-951f-d920586bc069
N:Foster;Jack;Allen;;
FN:Allen Foster
REV:20230408T122102Z
EMAIL;TYPE=home;TYPE=pref:allen@fosters.test
EMAIL;TYPE=work:jack.foster@company.test
TEL;TYPE=CELL:+1 (555) 123-4567
END:VCARD
4839ff64a8/examples/simple.nim (L1-L22)
Future Goals
- VCard 4.0 support
Debugging
Need to clean up and organize
Run tvcard3 tests in gdb:
$ cd tests
$ nim --debuginfo --linedir:on c tvcard3
$ gdb --tui tvcard3
Description
Languages
Nim
99.6%
Makefile
0.4%