Skip to content

Conversation

@fnino
Copy link

@fnino fnino commented Mar 2, 2022

When decoding an attachment the line.encoding is set to "ASCII-8BIT", even when reading an UTF-8 attachment. So, force the encoding indication and then check its compliant.

The fix is simple. An example of what happens is given in the attached email file "testrb.eml.txt" and a script which copies the relevant part of code with the force_encoding (attached .rb files were renamed to .rb.txt)

Run like so to see the bug: ruby bugutf.rb # creates a traceback

and like this to see the fix: ruby bugutf_fixed.rb # runs ok, accented characters like in "détails" are supported.

And thanks for all the good work, ,tj3 is amazing !

testrb.eml.txt
bugutf.rb.txt
bugutf_fixed.rb.txt

fnino added 2 commits March 2, 2022 16:08
When decoding an attachment the line.encoding is set to "ASCII-8BIT", even when reading an UTF-8 attachment.  So, force the encoding indication and then check its compliant.
Fix utf-8 bug for tj3ts_receiver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant