Sunday, August 30, 2009

Character Set in Email Subject

bazı iletilerin subject kısımlarında türkçe karakterler okunmuyor.

örnek.
Konu: %45'e varan indirim ile tatil fXrsatXnX kaXXrmayXn !
Subject: %45'e varan indirim ile tatil fXrsatXnX kaXXrmayXn !


okunanlarda ise:
Konu: KENDİ İŞİNİN PATRONU OL !
Gönderen: ilkonline.net
From: =?ISO-8859-9?B?aWxrb25saW5lLm5ldA==?=
To: destek@eczakoop.org.tr
Reply-To: mail@ihalegunu.com
Subject: =?ISO-8859-9?B?S0VORN0g3d7dTt1OIFBBVFJPTlUgT0wgISA=?=



To encode headers with character sets which use more than 7 bits, such as for including accented letters in an email's subject, the MIME standard offers the following format:

=?charset?encoding?result?=

* charset represents the character set used,
* encoding defines the encoding desired with two possible values:
o Q for quoted-printable
o B for base64
* result: text encoded using the method specified.

Below is an example of Quoted-Printable encoding with "Building façade" as the email's subject.

Subject: Building fa=?ISO-8859-1?Q?=E7ade?=

iletiyi oluşturan yazılımın karakter setlerini ayarlaması gerekiyor.

$from = "From: =?UTF-8?B?" . base64_encode($_POST['name']) . "?= <" . $
$_POST['email'] . ">\n";

produces a correctly encoded header. Same for subject.







http://www.webservertalk.com/archive390-2006-1-1343590.html
http://www.php.net/manual/en/function.mb-encode-mimeheader.php

No comments: