Convert Arabic text to HTML characters

I'm trying to send an email containing Arabic text, my problem is that when I add Arabic text to the email, it changes it to random letters (to do with character encoding of email, t).

Is there a built-in function or a user-defined function that I can use to convert Arabic to HTML (Ψ§) codes so that it appears in my HTML letter?

+3
html character-encoding vbscript asp-classic
source share
2 answers

Leave the HTML screens (ex ס ) and translate the email into HTML by setting ContentType to text/html

 'Create mailer mailer.ContentType = "text/html" 'User mailer 

To convert Unicode to HTML screens, you can use the built-in HTMLEncode function.

 mailer.BodyText = Server.HTMLEncode(body) 

Note. Your viewer should have an appropriate set of glyphs installed.

+1
source share

Have you tried setting the encoding type in the HTML header?

Add the following to the <head> section of your HTML:

 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 

This should result in your Arabic (and other non-ascii) characters being displayed correctly.

However, it is important to note that when sending emails in HTML format, you will always have a problem, because different common email clients have completely different capabilities - even more than browsers.

One person can open an email in the current version of Outlook, another in a ten-year copy. Someone may use some version of Thunderbird, and many others will use an email client such as Hotmail, Yahoo, Gmail or many others. Perhaps even people who still have their email address display text messages, not HTML.

You probably have no control over this, so it’s important to make sure that you have tested various email clients. However, given that you are sending Arabic text, it can be assumed that most of your recipients will use an email client that can successfully display Arabic, so hopefully this fact alone should mitigate the worst of these problems for you.

+1
source share

All Articles