Bug 220536 - Can't use external editor with non-UTF8 coding
Summary: Can't use external editor with non-UTF8 coding
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.14.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-12-29 15:32 UTC by Lothar
Modified: 2018-10-28 03:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed fix for the external editor bug in kmail2 (944 bytes, patch)
2015-05-12 22:01 UTC, Lothar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lothar 2009-12-29 15:32:13 UTC
Version:           1.12.2 (using KDE 4.3.4)
OS:                Linux
Installed from:    openSUSE RPMs

It's no problem to compose a mail using the internal editor of kmail in a non-UTF8 locale (e.g. LANG=de_DE) and send the mail with this encoding. But it's not possible to use an external editor with the character encoding of this locale (e.g. ISO-8859-1). All diacritical characters are replaced by "?". A workaround is to disable the external editor function in kmail, edit the mail in an externally opened editor and copy and paste the text into the kmail compose window. This works, and it should work, too, if the editor is opened by kmail.
Comment 1 Laurent Montel 2015-04-12 10:03:16 UTC
Thank you for taking the time to file a bug report.

KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.
Comment 2 Lothar 2015-04-12 19:31:40 UTC
Am 12.04.2015 um 12:03 schrieb Laurent Montel:
> https://bugs.kde.org/show_bug.cgi?id=220536
>
> Laurent Montel <montel@kde.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>           Resolution|---                         |UNMAINTAINED
>               Status|UNCONFIRMED                 |RESOLVED
>
> --- Comment #1 from Laurent Montel <montel@kde.org> ---
> Thank you for taking the time to file a bug report.
>
> KMail2 was released in 2011, and the entire code base went through significant
> changes. We are currently in the process of porting to Qt5 and KF5. It is
> unlikely that these bugs are still valid in KMail2.
>
> We welcome you to try out KMail 2 with the KDE 4.14 release and give your
> feedback.
>

Hi Laurent,

thanks for your answer. But this bug isn't fixed in KMail2/KDE-4.14. 
Non-ASCII characters entered in an external editor using the ISO8859-15 
encoding are still not preserved correctly.

But anyway, KMail isn't usable for me any more for another reason. It 
takes more than 5 minutes to start. I'm using a local IMAP server 
(dovecot) and KMail seems to be very inefficient as an IMAP client. I'm 
now using Thunderbird that doesn't have any problem with this setup. 
Maybe I can switch back to KMail under QT5/KDE5.

Best regards
Comment 3 Lothar 2015-05-12 22:01:49 UTC
Created attachment 92566 [details]
Proposed fix for the external editor bug in kmail2

Hi,

now I've eventually found the time to debug this issue myself. It's caused by the way the text is transferred to and from the external editor. The external editor works in the local encoding, but the code assumed an UTF8 encoding unconditionally. I've tested my proposed fix in an UTF8 and an ISO8859-15 locale and now it works in both locales. Maybe somebody can apply it to the "official" code.
Comment 4 Laurent Montel 2015-05-13 05:29:52 UTC
It will not work when editor save as utf8 by default.
Comment 5 Lothar 2015-05-14 15:18:39 UTC
Do you know such an editor? It would be a broken editor that should be fixed. Do you really want to support a broken editor at the expense of breaking the functionality with well-programmed editors like kate, kwrite, pico, nano, "gvim -f", ... ? The only editor I know, that doesn't use the content of LANG or LC_CTYPE, is gedit. But it has the option --encoding=.. and someone who wants to use gedit with another encoding than UTF8 has to specify this option. Therefore, kmail does also not work with a correctly configured gedit.
Comment 6 Laurent Montel 2015-05-14 19:48:18 UTC
yep kwrite
Comment 7 Lothar 2015-05-16 19:01:03 UTC
Kwrite?? That's one of the many editors that can _NOT_ be used by kmail because of this bug.
Comment 8 Laurent Montel 2015-05-16 19:04:46 UTC
For me it works fine.
Comment 9 Lothar 2015-05-17 10:29:08 UTC
I guess, because you are working in a locale that uses the UTF8 encoding. Just do the following (from your name, I guess you are a native French speaker):

Set your session language to a locale with the ISO8859-15 encoding, e.g. by setting LANG=fr_FR@euro or fr_FR.iso885915@euro in your ~/.profile, depending on your distribution. Then start a KDE session, open kmail and set "kwrite %f" as your external editor. Start a new message and enter some non-ASCII characters in the kwrite window. What do you see in the kmail editor window after you quit kwrite?
Comment 10 Laurent Montel 2015-05-17 19:07:22 UTC
Perhaps it doesn't work with LANG=fr_FR@euro but your patch will break it which is configurate by default.
So your patch is not enough for this default case no ?
Comment 11 Lothar 2015-05-23 09:57:30 UTC
What do you mean with "default case"? Today, the default encoding is usually UTF8 where the patch doesn't matter. It works with and without the patch. Only if the user explicitly specifies a locale with a different character encoding, then the patch is necessary. I like KDE because it gives me the freedom of choice between a variety of settings, including the user language and character map. Why do you want to restrict this freedom in this special case?

I've tested the patch under OpenSuse 13.2 and RHEL7 with the default UTF8 and with an ISO8859-15 character  encoding and it worked in all cases. Of course somebody who officially integrates this patch should make additional tests.
Comment 12 Denis Kurz 2017-06-23 20:01:44 UTC
This bug has never been confirmed for a KDE PIM version that is based on KDE Frameworks (5.x). Those versions differ significantly from the old 4.x series. Therefore, I plan to close it in around two or three months. In the meantime, it is set to WAITINGFORINFO to give reporters the oportunity to check if it is still valid. As soon as someone confirms it for a recent version (at least 5.1, ideally even more recent), I'll gladly reopen it.

Please understand that we lack the manpower to triage bugs reported for versions almost two years beyond their end of life.
Comment 13 Lothar 2017-06-24 08:40:07 UTC
(In reply to Denis Kurz from comment #12)

Hi Denis,

it seems, that the recent version of kmail doesn't have the option "Use external editor", so this bug isn't relevant any more. You can close it if you want.

And regarding the lack of manpower: I filed this bug report 7 1/2 years ago for the recent version of kmail at that time and I've also attached a simple fix. But this fix was never integrated. But this doesn't matter to me, because I didn't use kmail any more. It was so full of bugs, slow and unreliable, therefore I've switched to thunderbird after using kmail for many years until KDE 3.5.10. I will try kmail again if it stops using the bloated and buggy akonadi.

Lothar
Comment 14 Laurent Montel 2017-06-24 10:43:55 UTC
(In reply to Lothar from comment #13)
> (In reply to Denis Kurz from comment #12)
> 
> Hi Denis,
> 
> it seems, that the recent version of kmail doesn't have the option "Use
> external editor", so this bug isn't relevant any more. You can close it if
> you want.
> 
> And regarding the lack of manpower: I filed this bug report 7 1/2 years ago
> for the recent version of kmail at that time and I've also attached a simple
> fix. But this fix was never integrated. But this doesn't matter to me,
> because I didn't use kmail any more. It was so full of bugs, slow and
> unreliable, therefore I've switched to thunderbird after using kmail for
> many years until KDE 3.5.10. I will try kmail again if it stops using the
> bloated and buggy akonadi.
> 
> Lothar

I readded in 5.6.0 (future version) this feature as plugins
Regards
Comment 15 Andrew Crouthamel 2018-09-28 02:35:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Andrew Crouthamel 2018-10-28 03:42:19 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!