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

Edit subject french emails #59

Closed
Jaylo70 opened this issue Aug 2, 2022 · 14 comments
Closed

Edit subject french emails #59

Jaylo70 opened this issue Aug 2, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@Jaylo70
Copy link

Jaylo70 commented Aug 2, 2022

There seems to be a problem with the add-on. Now I modify subjects in french emails and the letters change to characters. It also affects the letters in the body of the email itself

SUBJECT: Plainte Aéroport Montréal-Saint-Hubert (7h13)

Nous sommes à l�écoute des citoyens afin de nous assurer que des mesures adéquates d�atténuation du bruit soient en place. Nous allons faire le suivi concernant votre plainte. L�évaluation des plaintes est effectuée à chaque réunion du Comité Consultatif sur le Climat Sonore qui regroupe

@DenB10
Copy link

DenB10 commented Aug 3, 2022

Hello,

I agree with the previous message, but I would like to point out that this only happens if the single option is unchecked (not local changes) and only for the subject (by me). There are apparently problems with accented characters (in French but probably also in other languages).

If the option is checked (changes only in the local Thunderbird database), the accents are well respected in the Subject column of the message list BUT the subject is not modified in the message header, which leads to clutter in the subject titles.

To finish, I indicate that I use Firefox ESR 102 under windows 64-bit.

Best regards

@Jaylo70
Copy link
Author

Jaylo70 commented Aug 3, 2022

Hi! The option finally opened and I was able to click on that choice in the settings. Everytime I would click on option I would get a blank page.

Everything seems to work when I modify the subject, I have yet to receive a french email to find out if everything still works.

Thanks

@TimeTurn-DE
Copy link

TimeTurn-DE commented Sep 10, 2022

Got a similar issue here with german special characters in subject (ü, ö, ä, ß). That leads to similar issues as in the french mail the thread starter mentioned. Setting to safe the mail only locally is not an option since the whole point for me to use this addon is to change the subject in IMAP. I also could use Outlook for this, but I plan to cancel my Office 365 subscription next year after the payed period expires anyway.

Example:
Dies ist ein Test mit Umlauten in Emails - über das Addin öfters reden mu� sein, ändern muss sich das

Should read:
Dies ist ein Test mit Umlauten in Emails - Über das Addin öfters reden muß sein, Ändern muss sich das

@bersien
Copy link

bersien commented Sep 15, 2022

Hi, I noticed a similar problem with Polish Language today Thunderbird ver. 102.2.2 x64 :( Dear developer, please fix this problem thx.

For example:

Oryginal subject: Proszę o opłacenie celem przedłużenia ważności domeny
After use EditEmailSubject MX ver. 6.1: Prosz� o op�acenie celem przed�użenia ważno�ci domeny

@bersien
Copy link

bersien commented Sep 27, 2022

Hi cleidigh, can you fix this problem ? Please :)

@akki42
Copy link

akki42 commented Oct 9, 2022

I tried to have a closer look at this - and I believe switching from unescape() to decodeURIComponent() function solves this problem.
(Such switch from unescape() to decodeURIComponent() function is anyway recommended by Mozilla, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape .)

I tried manually changing

headers = headers.replace(/\nSubject: .*\r\n/, "\nSubject: " + unescape(encodeURIComponent(request.newSubject)) + "\r\n");
headers += "Subject: " + unescape(encodeURIComponent(request.newSubject)) + "\r\n";
let EditEmailSubjectOriginal = ("X-EditEmailSubject-OriginalSubject: " + unescape(encodeURIComponent(this.msg.subject)));
and
msgHdr.subject = unescape(encodeURIComponent(aSubject));
in my local xpi accordingly, after which special characters (e.g. German Umlaute) seem to be saved correctly.
But I cannot judge whether this may have any undesirable side effects.

@TimeTurn-DE
Copy link

TimeTurn-DE commented Oct 9, 2022

What did you change in those lines? Did you remove encodeURIComponent in unescape? I'm quiet confused since the lines you posted are identical to the stock ones and I'm not skilled in java at all :)

EDIT: Found it out myself - simply remove encodeURIComponent and the brackets of the function. Worked fine for me - attaching my modified version - simply rename .zip to .xpi - after you verified that I did not change anything else of course :)

ees_v6.1_changed.zip

@akki42
Copy link

akki42 commented Oct 9, 2022

I replaced all instances of "unescape" with "decodeURIComponent".

For example, line 121 of editemailsubject.js will then read:
headers = headers.replace(/\nSubject: .*\r\n/, "\nSubject: " + decodeURIComponent(encodeURIComponent(request.newSubject)) + "\r\n");

But again: I simply do not know whether such change might have unintended consequences. (That's why I did not create a pull request...)

@TimeTurn-DE
Copy link

Yes, I did not either, only attached it for reference. Anyway, thanks for the fix, works fine now :)

@DenB10
Copy link

DenB10 commented Oct 12, 2022

Your two modifications are different, I have tried them both and neither is satisfactory.
The problem is well corrected for the subject but NOT for the body of the message whose accented characters are modified.

So, as the developer does not seem to react to this problem, I abandoned this extension and turned to another one which seems to work well: Header Tools Improved (https://addons.thunderbird.net/thunderbird/addon/header-tools-improved/).

Greetings and thank you for your efforts!

@bersien
Copy link

bersien commented Oct 13, 2022

Header Tool Improved for the Polish language also looks perfect. Thank you DenB10 for sharing the alternative extension :) 👍

@jobisoft jobisoft added the bug Something isn't working label Oct 16, 2022
@TimeTurn-DE
Copy link

Also installed header tools, looks much better, thanks

jobisoft added a commit that referenced this issue Jul 2, 2023
@jobisoft
Copy link
Collaborator

jobisoft commented Jul 2, 2023

Fixed in 85fcc5f

@jobisoft jobisoft closed this as completed Jul 2, 2023
@jobisoft
Copy link
Collaborator

jobisoft commented Jul 3, 2023

Please switch to v6.2, which introduced a backup option, to make sure no email is lost (there are such reports, v6.2 does fix something in that area)
https://github.com/cleidigh/EditEmailSubject-MX/releases/tag/v6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants