|
Posted by Tim Roberts on 03/28/07 06:54
"Ciuin" <ciuin@gmx.de> wrote:
>
>Instead of utf8_encode I need base64_encode, of course (as the "...?
>B?..." in the code tells me). So this:
>
>$from = "From: =?UTF-8?B?" . base64_encode($_POST['name']) . "?= <" . $
>$_POST['email'] . ">\n";
>
>produces a correctly encoded header. Same for subject.
For completeness, allow me to point out that you can also use
quoted-printable encoding here (you'd use =?utf-8?Q? instead of ...?B?).
Quoted-printable encoding has the "advantage" that ASCII characters survive
unchanged, so if there are ASCII words, they can be read even in their
encoded form.
On the other hand, strings with many non-ASCII characters grow more in
quoted-printable than in base64. Plus, there is no
"quoted_printable_encode" in the standard library, although sources are
available.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
[Back to original message]
|