Closed eadmaster closed 12 years ago
Regarding the line endings, it's hard to tell without the actual file. Virtually all vCards I've found on the web contain what is probably considered minor errors, which means they can only be handled by sufficiently fuzzy parsers. This program was written for those who wanted strict validation, to be able to use stricter (and thus simpler) parsers and to ensure maximum compatibility across fuzzy parsers.
The N
property does consist of exactly 5 values. From RFC 2426 section 3:
The structured type value corresponds, in sequence, to the Family Name, Given Name, Additional Names, Honorific Prefixes, and Honorific Suffixes. The text components are separated by the SEMI-COLON character (ASCII decimal 59).
Example (including multiple pre- and postfixes):
N:Doe;John;Samuel;Mr,Dr;Sr,Esquire
code:
error:
The actual line endings seems correct. The same vcard parses just fine in other programs.
EDIT: opening the file with "codecs.open(f, 'r', 'utf-8')" fixed the newline issue, but now i'm getting