|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-04-01 21:30 UTC] cconnors at online-buddies dot com
Description:
------------
The following character (?) is automatically stripped from a subject, but not the body using mail().
Quick fix is...
$subj = str_replace('?', '\'', $template->getSubject());
But it's not EXACTLY the same character.
I've played around with the header, and cannot get it to work with UTF-8.
Reproduce code:
---------------
header = "From: ". 'noreply' .
" <" . 'noreply@foo.net' . ">\n" .
"Reply-To: " . 'noreply@foo.net' . "\n" .
"Content-type: text/plain; charset=UTF-8\n\n";
mail('fake@foo.net', 'french d?avoir' , 'french d?avoir', $header);
Expected result:
----------------
Should get a message with:
subject: french d?avoir
body: french d?avoir
Actual result:
--------------
Actually get:
subject: french davoir
body: french d?avoir
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
Actually, that's not ISO-8859-1, that's Windows-1252: Subject: =?Windows-1252?Q?french d=92avoir?= Which illustrates the problem neatly: You have to know the character encoding in use to make sense of non-ASCII characters.