-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E-Mail charset is not set back to original during body.decode #403
Comments
This works for me on dozens of e-mails. Reading e-mails from Gmail using IMAP on Ruby 1.9.3. |
Rather than using [1] https://github.com/mikel/mail/blob/master/lib/mail/message.rb#L1786 |
a simple test from a project I'm working on now:
results in :
doing it as proposed by @januszm works as expected for me:
|
@webdevotion Call it on the text part: |
Thank you @jeremy. It's working now. |
@webdevotion—Great! |
I had a problem today because in my application ISO-8859-2 characters (diacritics) where not shown in mail body.
I've found out that I have to manually guess original mail charset and use it in {{{ force_encoding }}} method, to be able to save body content in MySQL database.
I think that mail gem should check charset before doing DECODE so that after .decode we can see original diacritics.
See http://stackoverflow.com/questions/10787791/ruby-rails-email-base64-gets-split-at-diacritics-and-content-lost-in-mysql/10790062#10790062
and what I wanted to have is:
The text was updated successfully, but these errors were encountered: