2014-04-11 51 views
0

該郵件應該是這樣的郵件的字符編碼

Subject: asd asd asd åäö åäö åäö 
Content: asd asd asd åäö åäö åäö 

但在雷鳥,它看起來像這樣

Subject: asd asd asd åäö åäö åäö 
Content: asd asd asd <weird question mark characters> 

這是在雷鳥查看源,有什麼錯呢?

Return-Path: <[email protected]> 
X-Original-To: [email protected] 
Delivered-To: [email protected] 
Received: from example.com (example.com [130.237.161.15]) 
    by example.com (Postfix) with ESMTP id 68270C0A20 
    for <[email protected]>; Fri, 11 Apr 2014 04:35:10 +0200 (CEST) 
From: Example <[email protected]> 
Message-ID: <[email protected]> 
Subject: =?UTF-8?Q?Forum_post:_asd_a?= 
=?UTF-8?Q?sd_asd_=C3=A5=C3=A4=C3=B6_=C3=A5=C3=A4=C3=B6_=C3=A5=C3=A4=C3=B6?= 
MIME-Version: 1.0 
Content-Type: text/plain; charset="utf-8" 
Content-Transfer-Encoding: quoted-printable 

asd asd asd =E5=E4=F6 =E5=E4=F6 =E5=E4=F6 

回答

1

你的內容類型說UTF-8但身體實際上是在ISO8859-1或類似的編碼(ISO8859-15非常相似,例如)。那些字節序列根本不是有效的UTF-8。

簡單的解決方法是將charset =更改爲實際的正確值,如果您知道它,或者可以放心地猜出它。如果你不能,也許你根本不應該生成這個信息。

+0

哪些字節序列?根據https://en.wikipedia.org/wiki/%C3%85å是c3 a5在utf8 – fred

+0

哦主題說c3 a5爲å但身體說e5這是不正確的(或者說,iso8859-1不是UTF8) – fred