ISO-8859-1 vs. UTF-8 encoding issue

94 views
Skip to first unread message

Roger Neel

unread,
Jul 17, 2011, 11:08:34 PM7/17/11
to Ruby's Mail Discussion Group
Hi all,

I was hoping somebody might be able to give me a little help with this
odd one. It turns out GMail is sending messages with German
characters as ISO-8859-1, which is valid, but I would have expected
UTF-8.

So, we're getting an encoded email with the plain text (or HTML) body
as:

-------
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Test email

With german:
Mit freundlichen Gr=FC=DFen
------

For some reason, this message's body.decoded is not returning those
characters properly (Mit freundlichen Grüßen) and is instead returning
"Mit freundlichen Gr��en" with the <?>'s in place of both the German
characters.

Does the ISO parser have a bug or is there a workaround I'm missing?

Thanks!
Roger

stephen c

unread,
Jul 19, 2011, 3:10:52 AM7/19/11
to Ruby's Mail Discussion Group
I found the same thing a few months ago. I had to patch mail to work
with Rails 2.3.x and made some other fixes to things like this. You
can browse the patches here: https://github.com/stepchud/mail/commits/actionmailer-2.3.8_compatible
You'll be interested in 771094a9 and 0ffd90eb7, at least, which you
can cherry-pick. I've been meaning to submit a pull request for some
of these but other things have gotten in the way.

Roger Neel

unread,
Jul 30, 2011, 1:31:44 PM7/30/11
to Ruby's Mail Discussion Group
Stephen, thanks so much for the super quick reply. I completely
missed it in my deluge of emails until just now.

It looks like those patches could be exactly what we're looking for.
I'll go through them and figure out how to cherry pick into our gem/
fork.

Mikel, any plans to take a look at these patches?
Reply all
Reply to author
Forward
0 new messages