PHP 生成的 Vcard:更改字符编码,以便可以显示重音字符

发布于 2024-12-01 23:07:50 字数 7802 浏览 0 评论 0原文

我正在使用 PHP 类生成 vcard: http://www.troywolf.com/articles /php/class_vcard/

但重音字符无法正确显示。我猜这与字符编码有关,但我一直无法找到更改它的方法。

我的所有文件都保存为没有 BOM 的 UTF8,脚本的输出如下所示:

BEGIN:VCARD
VERSION:3.0
CLASS:PUBLIC
PRODID:-//www.bla.com//Version 1//EN
REV:2011-08-30 03:19:49
FN:Heïdi DABODFE
N:DABODFE;Heïdi;;;
TITLE:Directrice
ORG:blablabla
ADR;TYPE=work:;;2 Imp. Les Plataness;Mirepoix;;09500;France
EMAIL;TYPE=internet,pref:[email protected]
TEL;TYPE=work,voice:05 61 68 64 38
PHOTO;ENCODING=BASE64;TYPE=JPEG:
/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkc
gSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCA
wKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LD
RQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgA
YABgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwM
CBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJS
YnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVl
peYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX2
9/j5+v/EAB8BAAMBAQEBAQE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+CW4JtbcPa3BQXVzcLDGkq8YDMwVsYBx9O1T2Fpc6Vq8D6psSEFJmk
mfeksYOPkK53dTyM4x7Vk6xcxvrsNjPI0Wn2hW3BUZ2gfefHcsSWP1+la2q3dhpGlW1ha38OryJ
eNdK0Qfy4o8ABcsFOWwCQBgbRW576k3bzPZfBXx51LwBdJaS2Md3p2547uXzw8E67jjCYwuBxt9
gMdq+l/h98VNI8TWsc/hrVol3fe0u9kwAfRH5I+hB/AV+exuLSOJLjzFku2mD+XGCFCY+bdkYBJ
xgD39q3NLe8luje25fT0MZEM0c6wbmC+jHL5Ixgf0rCdJPVaHg47I6GJXPB8kvwfyP0yi8cRWwA
1OzuLBum90zGf+BjK/rWhB4w0e5UGPUIXB/utn+Vfn94R/aL8Z+FElt7nVGMsJCiC5XB9+owPy/
nXYw/teak2mJd3uh2Fy7StEd0SueFBySQOuf0rF05o+WqZBjqbtFKS8n/AJ2Ps248ZaNajMmoQr
7M2P51Qn8atdIf7MsJ7kf89pV8uIf8CbAP4Z+lfJ0f7WczaYbuBdN02VVfNvFbkT7h90LhSpB4y
SRivNNY/aD8U+MZGTU9ZNpaE5kSHcGZcHheCM/lQqc2OjkONqv3lypdz6n+I/xk0LwlC82t6lFr
F6oJj021bMII/vd3x6YA45Hevlb4kfFXUvi7JKXuQAQBDYlxHtO4YxnAPAICgknI7jNefLf3etw
mERtdXO4M8znLBcnJLE4A5A5qC9sP7K1C2mXKWjFSs3mLKqtgErvXgkH/APVW8KSjq9z67AZPQw
L5pPmn3/4BXPnalLIqyRq1rCxRWyCVTLHHGMgZPOOnrVmLTtSfTo/It7ezmnjCq8t2kUsyZBG1G
YHkgcgc4475g04xLrscKTNPZlmkePccSqoLbT9do/Os+zeHxDqly+qaitpLMjOlxOG2GTsG2gkD
8K3PbnJv0P/Z

URL;TYPE=work:www.bla.com
NOTE:bla
TZ:-0500
END:VCARD

非常感谢任何帮助

I'm using a PHP class to generate vcard: http://www.troywolf.com/articles/php/class_vcard/

But accented character do not show properly. I guess this is related to the character encoding, but I have been unable to find a way to change it.

All my files are saved as UTF8 without BOM and here is what the outpout of the script looks like:

BEGIN:VCARD
VERSION:3.0
CLASS:PUBLIC
PRODID:-//www.bla.com//Version 1//EN
REV:2011-08-30 03:19:49
FN:Heïdi DABODFE
N:DABODFE;Heïdi;;;
TITLE:Directrice
ORG:blablabla
ADR;TYPE=work:;;2 Imp. Les Plataness;Mirepoix;;09500;France
EMAIL;TYPE=internet,pref:[email protected]
TEL;TYPE=work,voice:05 61 68 64 38
PHOTO;ENCODING=BASE64;TYPE=JPEG:
/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkc
gSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCA
wKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LD
RQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgA
YABgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwM
CBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJS
YnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVl
peYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX2
9/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAE
CdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1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lW1ha38OryJ
eNdK0Qfy4o8ABcsFOWwCQBgbRW576k3bzPZfBXx51LwBdJaS2Md3p2547uXzw8E67jjCYwuBxt9
gMdq+l/h98VNI8TWsc/hrVol3fe0u9kwAfRH5I+hB/AV+exuLSOJLjzFku2mD+XGCFCY+bdkYBJ
xgD39q3NLe8luje25fT0MZEM0c6wbmC+jHL5Ixgf0rCdJPVaHg47I6GJXPB8kvwfyP0yi8cRWwA
1OzuLBum90zGf+BjK/rWhB4w0e5UGPUIXB/utn+Vfn94R/aL8Z+FElt7nVGMsJCiC5XB9+owPy/
nXYw/teak2mJd3uh2Fy7StEd0SueFBySQOuf0rF05o+WqZBjqbtFKS8n/AJ2Ps248ZaNajMmoQr
7M2P51Qn8atdIf7MsJ7kf89pV8uIf8CbAP4Z+lfJ0f7WczaYbuBdN02VVfNvFbkT7h90LhSpB4y
SRivNNY/aD8U+MZGTU9ZNpaE5kSHcGZcHheCM/lQqc2OjkONqv3lypdz6n+I/xk0LwlC82t6lFr
F6oJj021bMII/vd3x6YA45Hevlb4kfFXUvi7JKXuQAQBDYlxHtO4YxnAPAICgknI7jNefLf3etw
mERtdXO4M8znLBcnJLE4A5A5qC9sP7K1C2mXKWjFSs3mLKqtgErvXgkH/APVW8KSjq9z67AZPQw
L5pPmn3/4BXPnalLIqyRq1rCxRWyCVTLHHGMgZPOOnrVmLTtSfTo/It7ezmnjCq8t2kUsyZBG1G
YHkgcgc4475g04xLrscKTNPZlmkePccSqoLbT9do/Os+zeHxDqly+qaitpLMjOlxOG2GTsG2gkD
8K3PbnJv0P/Z

URL;TYPE=work:www.bla.com
NOTE:bla
TZ:-0500
END:VCARD

Any help is much appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

溺渁∝ 2024-12-08 23:07:51

您是否尝试过一些不同的程序来导入此 VCARD?对于版本 3.0,它们应该可以使用 utf-8,除非其名称以“O”开头并以“tlook”结尾 ^^

看看这是否适合您:

FN;CHARSET=utf-8:Heïdi DABODFE
N;CHARSET=utf-8:DABODFE;Heïdi;;;

Did you try some different programs to import this VCARD? For Version 3.0 they should be fine with utf-8 unless its name starts with "O" and ends with "tlook" ^^

See if this works for you:

FN;CHARSET=utf-8:Heïdi DABODFE
N;CHARSET=utf-8:DABODFE;Heïdi;;;
九公里浅绿 2024-12-08 23:07:51

解决方案是这样的,

假设 $vcf 是一个包含 utf-8 字符的字符串:

file_put_contents($dir.$filename, utf8_decode($vcf));

刚刚发现,法语 utf-8 字符在 Outlook 中可以正确显示。

The solution is rather something like this,

assuming $vcf to be a string containing utf-8 characters:

file_put_contents($dir.$filename, utf8_decode($vcf));

French utf-8 characters get displayed properly in Outlook, just found out.

撕心裂肺的伤痛 2024-12-08 23:07:50

如果程序真的能按照标准来就好了!这就是它们的工作方式:

  • 对于 vCard 2.1,您应该使用 FN;CHARSET=utf-8;ENCODING=8BIT:Heïdi DABODFE,因为它也可能是ENCODING=QUOTED-PRINTABLE 并且许多程序确实使用它。我认为 Outlook 吃得很好,但是 Thunderbird 拒绝 ENCODING 部分(Thunderbird 还导出据称没有字符集/编码信息的 v2.1 vCard)。
  • 对于 vCard 3.0 使用不同字符集的可能性每个属性都消失了(这有什么意义?)。传输 vCard 时,您将使用 Content-type MIME 标头,这就是指定字符集的位置(RFC 第 5 节所述)。但是,您通常不会在 vCard 文件中找到内容类型标头,并且大多数程序仅使用 FN;CHARSET=utf-8;ENCODING=8BIT:Heïdi DABODFE ,就像 2.1 中一样。
  • 对于 vCard 4.0,vCard 文件的字符集始终为 UTF -8,并且没有办法覆盖它,并且在 MIME 标头中指定不同的字符集是无效的(RFC 的第 3.1 节)。

现实情况是,大多数程序很少关心 vCard,并使用相同的代码来处理版本 2.1、3.0 和 4.*。我使用 UTF-8 生成 vCard 来满足 RFC 6350,使用 CHARSET=utf-8 来满足 vCard 2.1 规范,避免 ENCODING=8BIT 来满足 Thunderbird,我目前考虑添加 MIME 标头。

不幸的是,到了2015年,这个听起来更像是20世纪80年代的问题仍然难以处理。

It would be good if programs would really follow the standards! This is how they should work:

  • For vCard 2.1, you should use FN;CHARSET=utf-8;ENCODING=8BIT:Heïdi DABODFE, because it could also be ENCODING=QUOTED-PRINTABLE and many programs really do use that. I think Outlook eats this well, however Thunderbird rejects the ENCODING part (Thunderbird also exports supposedly v2.1 vCards without charset/encoding information).
  • For vCard 3.0 the possibility of using a different charset for each property disappeared (what sense did it made?). You are to use the Content-type MIME header when transferring the vCard and that's where the charset is to be specified (says section 5 of the RFC). However, you don't usually find Content-type headers in vCard files and most programs just use FN;CHARSET=utf-8;ENCODING=8BIT:Heïdi DABODFE as it was for 2.1.
  • For vCard 4.0 the charset for vCard files is always UTF-8 and there is no way to override this and it is invalid to specify a different charset in a MIME header (section 3.1 of the RFC).

The reality is that most programs treat vCard with very little care and use the same code to handle versions 2.1, 3.0 and 4.*. I generate vCard using UTF-8 to satisfy RFC 6350, use CHARSET=utf-8 to satisfy vCard 2.1 specification, avoid ENCODING=8BIT to satisfy Thunderbird and I'm currently considering adding a MIME header.

It is unfortunate that in 2015 there is still difficulty in dealing with this problem which sounds more like a problem from the 1980s.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文