Karim AG
Karim AG

Reputation: 2193

HTML Anchor mailto Subject encoding issue in Outlook

I have this anchor element which uses mailto: to send the page as an email. The website is bilingual (English/Arabic), the English version works great, however the Arabic version on some machines has an issue with the encoding of the Subject characters which are sent in Arabic, here is my tag:

<a href="mailto:?subject=رسالة بالعربية&amp;body=blahblahblah">
    <i class="fa fa-envelope-o"></i>
</a>

Upon clicking this link on some machines, Outlook starts but the subject appears to be gibberish. I also tried to encode the text in the subject to no avail:

<a href="mailto:?subject=&#1585;&#1587;&#1575;&#1604;&#1577; &#1576;&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;&amp;body=blahblahblah">
    <i class="fa fa-envelope-o"></i>
</a>

Is there anything I can do on the page or on the broken machine to fix this?

Or is there any other way to achieve this without facing the same issue?

Regards.

Upvotes: 2

Views: 826

Answers (1)

Brandtware
Brandtware

Reputation: 483

Did you set an encoding for the html-Page? If not, some browsers may use the default-encoding of the operating system, resulting in correct display, while others may not.

Try adding the following tag to your "html-head" Area

<meta charset="utf-8"/>

(your tool/editor needs to safe it in that format that it works)

Upvotes: 2

Related Questions