srikanthtalasila / ez-vcard

Automatically exported from code.google.com/p/ez-vcard
0 stars 0 forks source link

Multi-line properties are written incorrectly for VCard 2.1 #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
VCard 2.1 specification section 2 (Delimiters) says:

""""
A formatted text line break in a property value, must also be represented by a 
(RFC 822) line break, which is a CRLF sequence. However, since the CRLF 
sequence is used to delimit a line, property values with formatted line breaks 
(i.e., multiple lines) must be encoded using an alternate encoding of either 
Quoted-Printable or Base64, as defined in RFC 1521.
""""

To reproduce the problem:

        VCard vcard = new VCard();
        vcard.addNote(new NoteType("Line one\r\nLine two"));

        StringWriter writer = new StringWriter();
        new VCardWriter(writer, VCardVersion.V2_1).write(vcard);
        System.out.println(writer);

Actual output is:

BEGIN:VCARD
VERSION:2.1
NOTE:Line one\nLine two
X-PRODID:ez-vcard 0.6.0
END:VCARD

Expected output is:

BEGIN:VCARD
VERSION:2.1
NOTE;ENCODING=QUOTED-PRINTABLE:Line one=0D=0ALine two
X-PRODID:ez-vcard 0.6.0
END:VCARD

Original issue reported on code.google.com by dna...@gmail.com on 2 Jan 2013 at 8:48

GoogleCodeExporter commented 9 years ago
Fixed in r339, thanks.

Original comment by mike.angstadt on 3 Jan 2013 at 2:52