using iconv()

Pavel Kankovsky peak at argo.troja.mff.cuni.cz
Sat Jan 8 22:31:20 CET 2005


On Sat, 8 Jan 2005, Evgeny Kotsuba wrote:

> For example, if we have 8-bit characters in heades like:
> --------------------------
> From: "Ń„â•â•”â•˜â•Ľâ•”â•Š" <radiodetali at fromru.com>
> Subject: Ё╼╧─┴═
> Date: Wed, 15 Oct 2003 15:59:21 +0400
> MIME-Version: 1.0
> Content-Type: text/html;
>         charset="koi8-r"
> X-Priority: 3
> ---------------------------
> So when we find charset we need go back  to From: and Subject.

No. The example you gave is a malformed message and whoever made a MUA
generating such a message and/or displaying such a message "correctly"
deserves a bullet into his or her head.

Non-ASCII text is prohibited in RFC 2822 headers (see section 2.2), and
Content-Type header does not affect the interpretation of other header
lines. Non-ASCII headers must be encoded using methods described in RFC
2047 and these methods incorporate the desired encoding into the encoded
value.

--Pavel Kankovsky aka Peak  [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."




More information about the bogofilter-dev mailing list