最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - What is the correct way to encode vCard data for QR codes (with line breaks in notes field)? - Stack Overflow

programmeradmin7浏览0评论

I'm trying to generate a QR code that contains contact information in vCard format with a multi-line note field. The QR code can be scanned by android and apple devices and the user can create a contact with the vcard info. This mostly works but the note field is giving me headache. What I want inside the note field:

Line 1
Line 2
...

So the note field consists of two (or more) lines. I tried vcard 2.1, 3.0 and 4.0. Version 2.1 and 3.0 with quoted-printable encoding, 4.0 with /n. It simply does not work, mostly on Android devices. But when I create a contact on my pixel, export it as vcard and import it -> that works and the new lines are still there.

Here are examples for all three versions and a qr code for each.

BEGIN:VCARD
VERSION:2.1
FN:John Doe
NOTE;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Line 1=0ALine 2=0ALine 3
END:VCARD

BEGIN:VCARD
VERSION:3.0
FN:John Doe
NOTE;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Line 1=0ALine 2=0ALine 3
END:VCARD

BEGIN:VCARD
VERSION:4.0
FN:John Doe
NOTE:Line 1\nLine 2\nLine 3
END:VCARD

For these examples, I generated the QR codes using goqr.me. I also tried several other QR code generators, but the result is always the same. I'm wondering if I'm missing something fundamental — did I use quoted-printable encoding incorrectly?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论