go-vcard icon indicating copy to clipboard operation
go-vcard copied to clipboard

`ENCODING=QUOTED-PRINTABLE` unsupported

Open Peltoche opened this issue 1 year ago • 3 comments

Hi, first of all thanks for you lib.

I have exported my contacts from the default contact app on an android phone (lineagos 21 enchiladas) and each time a field have an accent or a non-ascii character the file with have its content formatted as follow:

TITLE;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=4B=69=6E=C3=A9=73=69=74=68=C3=A9=72=61=70=65=75=74=65

For example this field TITLE field contains Kinésithérapeute as value. As you have probably guessed, when I parse it with you lib it will print directly the content without decoding.

The RFC6350 section 3.1 make a reference to the RFC3536 which have a reference to the QUOTED-PRINTABLE notation.

Peltoche avatar Jun 04 '24 19:06 Peltoche

Section 3.1 just says that the charset (a concept defined in RFC 3536) is always UTF-8. It does not define any parameter to change this, nor does it define any parameter to set the encoding.

ENCODING is defined for vCard v3: https://www.rfc-editor.org/rfc/rfc2425.html#section-5.8.3 (but QUOTED-PRINTABLE is not a proper value)

vCard v3 states, in the section "Differences From vCard v2.1": "The VCARD CHARSET type parameter has been eliminated. Character set can only be specified on the CHARSET parameter on the Content-Type MIME header field."

Are you trying to read vCard 2 files?

emersion avatar Jun 04 '24 19:06 emersion

Erf, yep indeed. The file have a V2 header. Do you plan to support it or this is out of your project scope ?

Peltoche avatar Jun 05 '24 07:06 Peltoche

So far I've been trying to avoid supporting vCard 2, because it's a lot more complex and ill-defined. Would need more investigation to figure out exactly what vCard 2 support would entail (see https://datatracker.ietf.org/doc/html/rfc2426#section-5).

Most likely the best way to implement it without introducing complexity all over the place would be to extend ToV4 to support vCard 2.

emersion avatar Jun 08 '24 10:06 emersion