电子邮件mailto主题行中的中文字符

发布于 2024-08-01 14:39:00 字数 702 浏览 1 评论 0 原文

我想在 mailto: 电子邮件链接中添加一些中文字符。

我已经尝试过,

<a href="mailto:[email protected]?subject=调查 / Inquiry">Email</a>

但是当我单击链接时,Outlook 主题行显示:

调查亡ª·æ£® / 查询

我也尝试过

<a href="mailto:[email protected]?subject=&#35843;&#26597; / Inquiry">Email</a>

,但得到了与上面相同的结果。

我意识到这可能是 Outlook 问题,但我有兴趣找出实现此功能的正确方法。

I'm looking to add some Chinese characters in a mailto: email link.

I've tried

<a href="mailto:[email protected]?subject=调查 / Inquiry">Email</a>

but when I click on the link the Outlook subject line shows:

调查亨德森 / Inquiry

I've also tried

<a href="mailto:[email protected]?subject=调查 / Inquiry">Email</a>

but I get the same result as above.

I realize this may be an Outlook issue but I'm interested in finding out the correct way to implement this functionality.

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

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

发布评论

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

评论(6

嘦怹 2024-08-08 14:39:00

原始 URL 编码

要使用特殊字符对 mailto 链接/标准链接进行编码,您可以使用 php 函数 rawurlencode

如果您正在寻找在线工具,请尝试 http://www. Cafewebmaster.com/online_tools/rawurlencode

使用您的示例:

[电子邮件受保护]?subject=调查/查询">电子邮件

将转换为:

[电子邮件受保护]?subject=%E8%B0%83%E6%9F%A5 / 询价">邮箱

Raw URL Encode

To encode mailto links / standard links with special characters you can use the php function rawurlencode

If you are looking for an online tool try http://www.cafewebmaster.com/online_tools/rawurlencode

Using your example:

<a href="mailto:[email protected]?subject=调查 / Inquiry">Email</a>

would convert to:

<a href="mailto:[email protected]?subject=%E8%B0%83%E6%9F%A5 / Inquiry">Email</a>

东走西顾 2024-08-08 14:39:00

由于主题位于邮件标头中,因此无法知道您正在使用什么编码。 您需要使用此 RFC 中定义的 MIME 邮件标头扩展,

http://www.ietf.org /rfc/rfc2047.txt

中文的主题是这样的,

Subject: =?GB2312?B?u7bTrbLOvNPDwLn61bm74Q==?=

但是现在越来越多的客户端采用UTF-8编码。 您可能也想尝试一下。

Since subject is in mail header, there is no way to know what encoding you are using. You need to use MIME Mail header extension defined in this RFC,

http://www.ietf.org/rfc/rfc2047.txt

The subject in Chinese would look like this,

Subject: =?GB2312?B?u7bTrbLOvNPDwLn61bm74Q==?=

But more and more clients assume UTF-8 encoding now. You might want try that also.

旧人 2024-08-08 14:39:00

因为outlook默认的字符集是gb2312,所以在对主题进行编码时,必须将汉字翻译成gb2313,然后再进行编码。
总之,你传递的字符集必须与outlook默认的字符集一致。

Because the default charset of outlook is gb2312, so when you encode the subject, you must translate the Chinese character to gb2313, then encode it.
In a word, the charset which you pass must be consistent with the default charset of outlook.

淡莣 2024-08-08 14:39:00

一段时间以来,我一直在尝试在主题行中放入非 ASCII 字符。 底线是:它不能可靠地工作。

我对它不起作用的(有限)理解是,标准规定电子邮件是 7 位 ASCII。 MIME 标准通过对电子邮件内容进行不同的编码来解决这个问题。 但是:主题行不是内容的一部分。 这是一个标题。

I've been trying to put non-ASCII characters in subject lines for a while now. The bottom line is: it does not work reliably.

My (limited) understanding of why it does not work is that the standards say that email is 7-bit ASCII. The MIME standard gets around that by encoding the contents of the email differently. However: the subject line is not part of the contents. It's a header.

沒落の蓅哖 2024-08-08 14:39:00

对于评论 #1 中的文本,请启用“工具->选项->邮件格式->国际选项”->“启用 mailto: 协议的 UTF-8 支持”

For your text in comment #1, please enable the "Tool->options->mail format->International Options"->"Enable UTF-8 support for mailto: protocol"

浅沫记忆 2024-08-08 14:39:00

这很麻烦,但可能,这里 是一篇很好的文章,讨论了 Internet Explorer 的理想世界和现实世界场景的标准兼容方式。

It's cumbersome but possible, here is a good article that discusses both the standard compliant way of an ideal world and real world scenarios with Internet Explorer.

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