Update: I fired up Fiddler and used its built-in TextWizard to play with the link subject string to see the effects of encoding/decoding on the bytestream -- basically, I confirmed that the mangling of the “è” is due to URL decoding of the un-encoded special character. So, Outlook is definitely doing a URL decode for the subject line.
Update 2: You may notice that my example link above to reproduce the problem I described doesn't mangle the subject line; seems that .Text went and converted the “è” to an HTML escape sequence (& # 232). Trust me, the problem persists!
So, I've been farmed out to one of our satellite teams who are busily working away at knocking off some pre-launch bugs in a SharePoint solution we developed for an enterprise client. The dev lead approached me today with a request to look into a very odd little bug that has had them stumped for a little while.
They have a ASP.NET (1.1) page that contains an anchor tag with a mailto: link that contains a subject heading that is bi-lingual (French and English):
Request Access/Demander d'accès
Problem: When the user clicks said link and triggers Outlook to launch a mail window (using Word as the editor), the “è” becomes mangled:
Request Access/Demander d'accès
Assuming you have Outlook or Outlook Express installed, you can try this out below:
Un-encoded bilingual link.
I spoke with a team member who had tried to tackle this by leveraging HttpUtility.UrlEncode to try and apply a wide assortment of character encodings to the link text (which was being supplied from a resource assembly) without any luck. They were unable to address the issue server-side and so were beginning to look at Outlook and elsewhere for solutions.
On a whim, I tried hand-encoding the “è” with the URL equivalent “%E8“, and 'lo! It worked! It seems that Outlook is mis-coding the character from the web page to the mail window -- my guess is that it's getting lost in translation between UTF-8 and Unicode somehow. Try this link:
Encoded bilingual link.
In the final analysis, this is a cheap-fix and we still need to determine why when UrlEncode is used, that the link doesn't work. Use this knowledge for good and not evil!