Using Ruby-1.9.2-p0 and mail-2.2.6.1 ruby-1.9.2-p0> mail = Mail.new <<-EOT X-Original-To: support@lvh.me Return-Path: Received: from smarthost01.example.org (smarthost01.example.org [91.186.91.50]) by drift.example.org (Postfix) with ESMTP id 9E2792C3418 for ; Tue, 14 Sep 2010 12:11:08 +0200 (CEST) From: Foobar To: "test@foo.example.org" Content-Class: urn:content-classes:message Date: Tue, 14 Sep 2010 12:10:59 +0200 Subject: Test email Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 This is an email with Windows-1252 charset. The body is encoded = using quoted-printable. Here's some quoted text: Systemingeni=F8r Foo Inc. p=E5tar seg ikke ansvar for ufull=ADstendig =F8l EOT ruby-1.9.2-p0> mail.charset => "Windows-1252" ruby-1.9.2-p0> mail.body.charset => "US-ASCII" ruby-1.9.2-p0 > mail.body.encoding => "quoted-printable" ruby-1.9.2-p0 > mail.body.to_s.encoding => # # To get the result I'm looking for, I have to do this: ruby-1.9.2-p0> result = mail.body.to_s.encode(mail.charset).encode("UTF-8") => "This is an email with Windows-1252 charset. The body is encoded using quoted-printable.\r\n\r\nHere's some quoted text:\r\nSystemingeniør\r\n\r\nFoo Inc. påtar seg ikke ansvar for ufull­stendig øl" # This doesn't work because mail.body.encoding is US-ASCII and not Windows-1252(?) ruby-1.9.2-p0 > mail.body.to_s.encode("utf-8") == result => false