What happens to Russian letters when sending via a PHP request to ... mail, for example? "hard-coded" Russian letters are displayed correctly, but from a textboxex form with hieroglyphs:
HTML page:
<tr>
<td style="width: 280px"> </td>
<td><input type="text" id="workContent"/></td>
</tr>
PHP page:
$WorkContent = $_REQUEST["workContent"];
$WorkContentLabel = " ";
$message .= $WorkContentLabel . ":\t" . $WorkContent . "\n";
$to = "test@gmail.com";
$from = "me@domain.com";
$from_header = "From: Russian site command ";
$subject = "Message with russian letters";
$subject = '=?utf-8?B?'.$subject.'?=';
$message .= $subject;
mail($to, $subject, $message, $from_header);
The user enters some content in the text box:
alt text http://lh3.ggpht.com/_1TPOP7DzY1E/S1y6Y0wb9tI/AAAAAAAAC88/OkdMQkO47HQ/s800/works.png
and submits the form.
What will I get (in GMAIL):
: 1)ЎѕґµЂ¶°Ѕµ 2)RABOT
So, the hard-coded Russian text is OK, sent by the Russian text form is NOK , the ASCII text sent by the form is OK.
Does anyone know what could be causing this weird coding behavior?
EDIT: used
$subject = " - subject with russian letters";
$subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';
$message .= $subject;
,
ÿ - http://lh6.ggpht.com/_1TPOP7DzY1E/S1zFqFe9ohI/AAAAAAAAC9E/PZ7C4JtEHTU/s800/subject.png