Mailto unreadable characters - unicode

I am using the mailto URI scheme on my website to email the current page.

The problem is that I use Hindi as an object in the mailto link

Example

<a href="mailto: test@gmail.com ?subject=मानक हिन्दी">Testing</a> 

When you click on the link, Outlook (version 6) opens and displays some unreadable characters as a theme instead of " मानक हिन्दी ", i.e. I get " " ¤¤¤¤¾¾¤¤¤¤¤¤¹¤¹¤¹¤¹¤¹¤¹¤¹¤¹¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ " " " " " " " " " " " " " " " " " " " " " "¥" " " " " " ¥ "" " ¥ " ¥ "" "" "" "" "" ""

I use PHP, so I tried using urlencode, utf8_encode and other similar functions, and this is useless. And the default character set for the page is UTF-8

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

But I need this as a mailto link ... What will be the solution?

+4
source share
3 answers

Unfortunately, this can only be fixed at the end of Outlook by setting the "Allow UTF-8 support for the mailto: protocol. (In 2010, this is located under Options → Advanced → International Settings.)

Otherwise, and by default, Outlook will use the default default encoding for the local user (ANSI code page), which is never UTF-8. This makes the use of non-ASCII characters in mailto: URLs so unreliable as to be useless. (Even more than the normal insecurity of subject= .)

In general, the idea of ​​URL coding a non-ASCII string was correct: using a URI, for example:

 <a href="mailto: test@gmail.com ?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> 

More reliable than IRI format with raw Unicode. However, this does not apply to the Outlook problem.

+4
source

The old prospect, as far as I know, uses local encoding instead of Unicode for emails, so any Unicode string will be scrambled - perhaps it is possible to set the encoding for mailto - but I'm not sure

0
source

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

For reference, the “standard” that you want to refer to is RFC 2047 .

The solution I implemented to get around this limitation (only with European languages ​​and accents, and not with something exotic like Hindi) is to use a web form instead of the mailto: link. This requires more server-side configuration, but gives you much more control over the contact process.

0
source

Source: https://habr.com/ru/post/1380605/


All Articles