Question

I need to parse vCard 2.1 Name property.

In vCard 3.0 and 4.0 each component of the Name property can have multiple values. For example RFC 2426 clearly states:

Individual text components can include multiple text values (e.g., multiple Additional Names) separated by the COMMA character (ASCII decimal 44).

but in vCard 2.1 it looks like each component can have only one value. Even though probably at least Additional Names (third field) can have commas in it.

Can vCard 2.1 Name property have comas in Family Name, Given Name, Additional Names, Name Prefix and Name Suffix strings? Should this be treated as "multiple text values" as in vCard 3.0 and 4.0?

Was it helpful?

Solution

According to the formal BNF definition in the 2.1 specs, a comma-delimited list of values within a component is not supported. The BNF says nothing about having to escape comma characters.

nameparts   = 0*4(strnosemi ";") strnosemi
; Family, Given, Middle, Prefix, Suffix.
; Example:Public;John;Q.;Reverend Dr.;III, Esq.

strnosemi   = *(*nonsemi ("\;" / "\" CRLF)) *nonsemi
; To include a semicolon in this string, it must be escaped
; with a "\" character.

One of the examples sited for the N property also seems to imply that commas have no special meaning.

N:Veni, Vidi, Vici;The Restaurant.

So, it looks like the N property does not support multiple values in vCard 2.1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top