?ISO-8859-1?Q? from IMAP server

M

Maria Almar

Hi all,

I have an encoding problem when a want to examine my mails from an IMAP server.
Strings with "special characters" are returned with the
"?ISO-8859-1?Q?" prefix and special characters are messed up ("é"
becomes "=E9")

Do I have to call IMAP with special parameters ?
Or can I convert this string afterward ?

# Login to the Imap server
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.login(name, password)
# Examine the INBOX box
imap.examine("INBOX")
# Fetch a single message
msg = imap.uid_fetch([123], ['ENVELOPE'])[0]
puts msg.attr["ENVELOPE"].subject

=> =?ISO-8859-1?Q?Invitation_to_join_XXX_from_Nicolas_F=E9tiou?=

I'm on Leopard, and tried with "irb" and "irb --noreadline"

Regards

Maria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top