title: Special characters in UTF8 mailto: subject= link and Outlook
body: <p>I'm in the last stages of re-coding a site that formally used iso-8859-1 character encoding, but now is UTF-8 throughout.</p>
  
  <p>The problem is that the subject section of the mailto href link is not working with Outlook, when special characters are used. I get the usual garbled character representations, indicative of an obvious character encoding issue when the link is clicked and the new mail window pops up in outlook.</p>
  
  <p>I've tried rawurlencode() to fix ths issue, but this doesn't seem to work with Outlook...</p>
  
  <pre><code>&lt;a href="mailto:blah@blah.com?subject=&lt;?=rawurlencode($subj);?&gt;"&gt;send email&lt;/a&gt;
  </code></pre>
  
  <p>So then thought, Outlook must insist on a different encoding, and tried utf-8 decoding the subject string first...</p>
  
  <pre><code>&lt;a href="mailto:blah@blah.com?subject=&lt;?=rawurlencode(utf8_decode($subj));?&gt;"&gt;send email&lt;/a&gt;
  </code></pre>
  
  <p>Bingo! Works great Outlook. But now fails in everything else :(</p>
  
  <p>I can't find a solution that works accross all mail clients.</p>
  
  <p>It worked fine across all mail clients when the whole page was displayed in iso-8859-1. But not when the page content is utf-8.</p>
  
  <p>Unfortunately the client wants to retain this direct email link, despite having a functioning mail form directly beneath it!</p>
  
  <p>Is there a happy solution to this?</p>