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 代码字符
基础教程推荐
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
