Commit d0f37e74 authored by Kevin Krammer's avatar Kevin Krammer
Browse files

Treat \N as a valid new line sequence in vcard input

The vCard RFC has a note on fields of type text that suggests that
both \n and \N are to be treated as new line sequences:

        . The method for specifying CRLF character sequences in text
          type values has been changed. The CRLF character sequence in
          a text type value is specified with the backslash character
          sequence "\n" or "\N".

Backport of f7a29b54

BUG: 297541
FIXED-IN: 4.8.3
REVIEW: 104509
parent 0afce875
BEGIN:VCARD
FN:test
N:test;;;;
NOTE:line one\Nline two\Nline three\N
UID:8OD165Pope
VERSION:3.0
END:VCARD
BEGIN:VCARD
FN:test
N:test;;;;
NOTE:line one\nline two\nline three\n
UID:8OD165Pope
VERSION:3.0
END:VCARD
......@@ -38,6 +38,7 @@ static void addEscapes( QByteArray &str )
static void removeEscapes( QByteArray &str )
{
str.replace( (char *)"\\n", "\n" );
str.replace( (char *)"\\N", "\n" );
str.replace( (char *)"\\r", "\r" );
str.replace( (char *)"\\,", "," );
str.replace( (char *)"\\\\", "\\" );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment