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 代码字符
![](/xwassets/images/pre.png)
![](/xwassets/images/next.png)
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- addEventListener 在 IE 11 中不起作用 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Fetch API 如何获取响应体? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01