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

Emoji's in the subject with RFC 2047 encoding are not handled well #82

Open
noloader opened this issue Feb 15, 2025 · 0 comments
Open
Assignees
Labels

Comments

@noloader
Copy link

noloader commented Feb 15, 2025

Hi Everyone. Thanks for the tool. I've been looking for a tool to convert emails to pdfs for a while.

I noticed emoji's in the subject are not handled well. Encoding of subjects is covered in RFC2047:

encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

Here's an example from GMail:

Image

When I "view Original" in GMail and then "Download Original" message, the subject is encoded per RFC 2047 as:

=?utf-8?q?=F0=9F=92=8B_Unlock_Your_Perfect_Valentine=27s_Date_Today_=F0=9F=92=9D?=

Then, after conversion using email-to-pdf-converter, I see:

Image

Notice the emojis have disappeared for the subject in the pdf. Emoji's in the body are also missing, but I am less concerned about that.

Attached is the original message, screen captures, and a converted email to pdf: test-subject-with-emojis.zip.


Here is the command I used to perform the conversion. emailconverter-3.0.0-all.jar was downloaded from this GitHub.

$ java -jar emailconverter-3.0.0-all.jar test-subject-with-emojis.eml

which results in:

$ java -jar emailconverter-3.0.0-all.jar test-subject-with-emojis.eml 
Start converting test-subject-with-emojis.eml to test-subject-with-emojis.pdf
Mime Structure of test-subject-with-emojis.eml:
-----------Mime Message-----------
> multipart/mixed
> |  text/html
----------------------------------
Extract the inline images
Start conversion to pdf
The switch --viewport-size, is not support using unpatched qt, and will be ignored.The switch --image-quality, is not support using unpatched qt, and will be ignored.Loading page (1/2)
Printing pages (2/2)                                               
Done                                                           
Conversion finished

And if needed:

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Libre Office has a similar bug at https://bugs.documentfoundation.org/show_bug.cgi?id=129523. In the past I tried to convert emails to pdf using Libre Office tools.


And to be clear, these types of messages are spam. My need to convert them to pdf is due to a hobby of mine. I like to cause problems for spammers and their service providers. I've dragged them into court in the past. Moving forward, I would like to ensure the lawyers and judge see the annoying emojis.

(It is more like return the favor to spammers and service providers, considering how much time and effort I waste on sifting through their crap while trying to maintain free software projects and their websites).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants