Dear all,
I am having the same issue. I don't understand which encoding to use to send email subjects from Silverstripe.
As a temporary measure, I use the following function to remove most common French characters, but I would like to know how to proceed.
Warm regards,
Denis
function removeAccents($remove_from)
{
// Remove all instances of accents
$accent_array = array('e' => array('é','è','ê','ë'),
'E' => array('É','È','Ê','Ë'),
'a' => array('á','à ','â','ä','å'),
'A' => array('Ã','À','Â','Ä','Ã…'),
'i' => array('ï','ì','î'),
'I' => array('Ã','ÃŒ','ÃŽ'),
'o' => array('ö','ô','ò'),
'O' => array('Ö','Ô','Ò'),
'u' => array('ü','û','ù'),
'U' => array('Ü','Û','Ù')
);
foreach($accent_array as $acc_key => $acc_val_array)
{
$reg_exp_accent = '';// clear regular expression var
for($m=0;$m<count($acc_val_array);$m++)
{
$reg_exp_accent .= $acc_val_array[$m].'|';// create the regular expression var
}
$reg_exp_accent = substr_replace($reg_exp_accent,"",-1);// remove last '|'
$remove_from = ereg_replace($reg_exp_accent,$acc_key,$remove_from);
}
return $remove_from;
}