Skip to content

Fix utf-8 bug for tj3ts_receiver - #1

Merged
fnino merged 1 commit into
masterfrom
fnino-patch-1
Mar 2, 2022
Merged

Fix utf-8 bug for tj3ts_receiver#1
fnino merged 1 commit into
masterfrom
fnino-patch-1

Conversation

@fnino

@fnino fnino commented Mar 2, 2022

Copy link
Copy Markdown
Owner

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.

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

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

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.
@fnino
fnino merged commit 2003819 into master Mar 2, 2022
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