I've been having some recent troubles with PHP and encoding when sending e-mails. We have a form where our customers can enter a message and send it to a specific person. It's purposes is such that it makes sense to copy content from websites, such as msnbc. MSNBC in particular uses "smart quotes" which are angeled and are not the same for the beginning and end. These characters and others are included in the text box. When the send button is pressed and the message comes across, the smart quotes end up like this:
“ and â€
I'm only using the example of smart quotes, but this appears to happen with other characters our customers might send across, so just doing a str_replace for these doesn't cut it. I've searched the internet and my PHP books turn up nothing useful. I am very inexperienced with encoding schemes, etc. Surely this is not that uncommon of a problem. To help out, here are some values from phpinfo() that might have something to do with this:
(Environment)LANG: en_US.UTF-8
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1
Any responses appreciated. Thank you,
Ben Hughes