Aakash Chakravarthy
Aakash Chakravarthy

Reputation: 10691

mailto unreadable characters - unicode

I am using the mailto URI scheme in my website for emailing the current page.

The problem is i use Hindi as the subject in the mailto link

Example

<a href="mailto:[email protected]?subject=मानक हिन्दी">Testing</a>

When the link is clicked, the Outlook(version 6) opens and it displays some unreadable characters as subject instead of "मानक हिन्दी" i.e i get "'मानक हिनà¥à¤¦à¥€"

I am using PHP so i tried using urlencode, utf8_encode and other similar functions and it is of no use. And the page's default character set is UTF-8

When i directly paste the text मानक हिन्दी, it works.

But i need it as a mailto link... What will be the solution ?

Upvotes: 4

Views: 1776

Answers (3)

ghoti
ghoti

Reputation: 46826

As bobince said, Outlook has its limitations. Microsoft has published documentation that states that properly configured Outlook 2003 and 2007 attached to a properly configured Exchange server will default to supporting Unicode, but that doesn't really help you with the general public.

For reference, the "standard" you want to refer to for this is RFC 2047.

The solution that I have implemented to get around this limitation (only with European languages and accents, not with as something as exotic as Hindi) is to use a web form instead of a mailto: link. It requires more setup on the server side, but gives you a lot more control over the contact process.

Upvotes: 0

bobince
bobince

Reputation: 536339

Unfortunately this can only be fixed at the Outlook end, by setting the option ‘Allow UTF-8 support for the mailto: protocol’. (In 2010 this is under Options -> Advanced -> International options.)

Otherwise, and by default, Outlook will use the user's locale-specific desktop default encoding (the ‘ANSI’ code page) which is never UTF-8. This makes using non-ASCII characters in a mailto: URL so unreliable as to be effectively useless. (Even more than the normal unreliability of subject=.)

In general the idea to URL-encode the non-ASCII string was the right one: using a URI like:

<a href="mailto:[email protected]?subject=%E0%A4%AE%E0%A4%BE%E0%A4%A8%E0%A4%95%20%E0%A4%B9%E0%A4%BF%E0%A4%A8%E0%A5%8D%E0%A4%A6%E0%A5%80">Testing</a>

Is more reliable than the IRI format with the raw Unicode. However this does not address the Outlook issue.

Upvotes: 4

SergeS
SergeS

Reputation: 11779

Older outlook as far as i know is using local encoding instead of Unicode for emails, so any unicode string will be scrambled - there may be an option to set encoding for mailto - but not sure

Upvotes: 0

Related Questions