Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vCard v4.0 parsing: ADR LABEL parameter: Decode \n #685

Open
respiranto opened this issue Sep 23, 2024 · 0 comments
Open

vCard v4.0 parsing: ADR LABEL parameter: Decode \n #685

respiranto opened this issue Sep 23, 2024 · 0 comments

Comments

@respiranto
Copy link

Per RFC 6350#6.3.1, in the LABEL parameter on the ADR property, "[n]ewlines are encoded as \n, as they are for property values."

Consequently, upon parsing, \n should be decoded to newline characters. This is currently not the case.

Example (from the RFC):

ADR;GEO="geo:12.3457,78.910";LABEL="Mr. John Q. Public, Esq.\n
 Mail Drop: TNE QB\n123 Main Street\nAny Town, CA  91921-1234\n
 U.S.A.":;;123 Main Street;Any Town;CA;91921-1234;U.S.A.

Because of the updating RFC 6868, I believe that for encoding, ^n must be used in place of \n (as is currently the case). However, I believe that \n should still be decoded to a newline character--if strict adherence to the RFCs is desired.

On the other hand, I think RFC 6350 is somewhat broken in this case. It is open to speculation whether, as with property values, \N and \\ (and possibly others) are also special encodings. If not, it is impossible to encode a literal \n.

@respiranto respiranto changed the title v4.0 parsing: ADR LABEL parameter: Decode \n vCard v4.0 parsing: ADR LABEL parameter: Decode \n Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant