I've just created this code snippet to improve the user-customizable emails sent by one of my websites.
The goal was to use UTF-8 (Unicode) so that non-english users have all the Unicode benefits, BUT also make life seamless for English (or specifically, English MS-Outlook users). The niggle: Outlook prior to 2003 (?) does not properly detect unicode emails. When "smart quotes" from MS Word were pasted into a rich text area and saved in Unicode, then sent by email to an Outlook user, more often than not, these characters were wrongly rendered as "greek".
So, the following code snippet replaces a few strategic characters into html entities which Outlook XP (and possibly earlier) will render as expected. [Code based on bits of code from previous posts on this and the htmlenties page]
<?php
$badwordchars=array(
"\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x94", "\xe2\x80\xa6" );
$fixedwordchars=array(
"‘",
"’",
'“',
'”',
'—',
'…'
);
$html=str_replace($badwordchars,$fixedwordchars,$html);
?>