Erm, it's actually working, but in an unexpected combination.
I have set my main parent page's encoding to:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
And adjusted as you instructed. I am posting the relevant piece of the code as follows:
$headers="Return-Path:info@somemail.com\nMIME-Version: 1.0\r\nContent-type: text/plain; charset=utf-8\r\n";
This produced garbage. At least I thought. But looking better, I remembered something related to codepages and Croatian characters I knew from the prepress and font issues in PS/PDF generation. Half of Croatian accented characters are positioned the same in Win-1250 and iso 8859-2 charset as in Unicode range.
The other half characters, I was receiving here as garbage, have different positions in Win-1250 and iso 8859-2 than in Unicode. In Unicode, these characters lie within the extended Unicode range and are placed in different positions within the font table than they are in latter two codepage standards.
Surprisingly, in this combination, the characters that are positioned differently in Unicode got themselves remapped to iso- codepage, although $headers was supplying the UTF-8 information. Could it be settings on a webserver?
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
mbstring.http_input pass pass
mbstring.http_output pass pass
mbstring.internal_encoding ISO-8859-1 no value
mbstring.language neutral neutral
mbstring.substitute_character no value no value
However, if I set this:
$headers="Return-Path:info@somemail.com\nMIME-Version: 1.0\r\nContent-type: text/plain; charset=iso-8859-2\r\n";
BUT leave parent page encoding in UTF-8, I am getting all characters displayed properly, and all my accented characters are displayed properly.
And it works.
rachel2004, thanks a lot for your time and help. A LOT. You made me think and test various combinations and now I'm a happy mailman 😃
mkarabulut, have you tried setting the main page's encoding to utf-8 but send headers as iso-8859-9?