Convert Arabic text to HTML Code characters(将阿拉伯文本转换为 HTML 代码字符)
问题描述
我正在尝试发送一封包含阿拉伯文本的电子邮件,我的问题是当我将阿拉伯文本添加到电子邮件中时,它会将其更改为随机字母(与电子邮件的字符编码有关 - 我可以't改变).
I'm trying to send an email containing Arabic text, my problem is that when I add the Arabic text to the email, it changes it to random letters (to do with the character encoding of the email - which I can't change).
是否有内置函数或自定义函数可用于将阿拉伯语转换为 HTML 代码 (ا),以便随后出现在我的 HTML 电子邮件中?
Is there a built in function or a custom function I can use to convert the Arabic to HTML Codes (ا) so it will then appear in my HTML email?
推荐答案
保留 HTML 转义符(例如 ס
),并通过设置 ContentType
到 text/html
Leave the HTML escapes (ex ס
) in, and turn the e-mail to HTML by setting ContentType
to text/html
'Create mailer
mailer.ContentType = "text/html"
'User mailer
要将 unicode 转换为 HTML 转义,您可以使用内置函数 HTMLEncode.
To convert the unicode to HTML escapes you can use the built in function HTMLEncode.
mailer.BodyText = Server.HTMLEncode(body)
注意:您的查看器需要安装适当的字形集.
这篇关于将阿拉伯文本转换为 HTML 代码字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将阿拉伯文本转换为 HTML 代码字符


基础教程推荐
- 如何在特定日期之前获取消息? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01