Reply to Re: Non-ascii email subject and header encoding

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация