My form has issues with latin characters (portuguese). If the user submitted his info with special characters, I get the info on my email with messed up characters. The rest is fine (the form page presents special characters ok, it’s only the emails I receive that have messed up characters with the user’s info).
Long story short, I may have found where to fix it. The Where, but not the How.
Here is the bit where I think it can be fixed:
$content = $fields['name'] . " has sent you a message through the your Form:\r\n\n";
$content .= "-------\n" . $fields['message'] . "\r\n\n";
$content .= "Contact reason: " . $fields['contact_reason']
. " \n\nEmail: " . $fields['email']
. " \n\nPhone: " . $fields['phone'] . " \n\n";
How to add some code to it so that i can convert the user input data to ISO-8859-1? Or is this not the right place to do it?
P.S.: This is a script I purchased. The owner did not reply back and does not offer support.
Firstly, you must know whether the Portuguese characters can be fully converted to ISO-8859-1 (check this, not even all European languages can be converted, e. g. Hungarian ő and ű can’t be converted to ISO-8859-1). If not, you’ll have to change settings of your email. If yes, you might want to use utf8_decode, mbstring or iconv.