You are here: Re: Non-ascii email subject and header encoding « PHP Programming Language « IT news, forums, messages
Re: Non-ascii email subject and header encoding

Posted by Manuel Lemos on 03/29/07 03:20

Hello,

on 03/27/2007 06:55 AM Ciuin said the following:
> Hi all,
>
> I need to mail() emails with user input that does contain non-ascii
> (umlauts, accents) and non-latin (cyrillic) characters in the
> "Subject:" and "From:" headers. I understand that they are typically
> encoded in UTF8 like this:
>
> =?UTF-8?B?w5Z0emkg0J/RgNC40LLQtdGC?=
>
> but I cannot find a PHP function to encode the input string in this
> way. utf8_encode gives me garbled char soup, so what do you use?

That is binary q-encoding. It is not quoted-printable but it is similar
for message headers. There is a whole RFC on that subject.

Yoy may want to try the MIME message that can be used to compose and
send messages and supports headers with non-ASCII characters encoded as
UTF-8 or any other encoding.

Take a look at the test_multibyte_message.php example script. It
explains how to send messages in Japanese with encoding ISO-2022-JP, but
you can change that for UTF-8 to support characters of all idioms.

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

 

Navigation:

[Reply to this 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

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