Skip to content
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

Fix UTF-8 issue in tj3ts_receiver #279

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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

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