Hi, hi, hi little droogies
First of all, sorry for the lame english and the dumb question. After a
quick search on google I found iconv, and some other toys, but the point
is:
I’m making a small webmail app for my company, still taking the first
steps. For instance, if I want to read my INBOX folder and list the
messages:
CONTROLLER =>
def list_inbox
imap = Net::IMAP.new(‘xxx.xxx.xxx.xxx’)
imap.authenticate(‘LOGIN’, ‘[email protected]’, ‘password’)
imap.select(‘INBOX’)
@emails = []
imap.search([“ALL”]).each do |i|
@emails << imap.fetch(i, “ENVELOPE”)[0].attr[“ENVELOPE”]
end
imap.disconnect
end
VIEW =>
Webmail#list_inbox
<% @emails.each do |i| %>
<%= i.from[0].name %> / <%= i.subject %>
<% end %>
The enconding seems messed up, when the message comes in iso-8859-1
format, it’s preceeded with “=?iso-8859-1?Q?”, same for utf-8
“=?UTF-8?Q?”. And the accents come encoded too (=E9 => é).How can I
solve this?
Thanks in advance.