Bug 350774 - Incorrect charset encoding viewing message from file
Summary: Incorrect charset encoding viewing message from file
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: composer (show other bugs)
Version: 4.14.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-29 21:49 UTC by Raúl
Modified: 2021-03-11 01:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sample email with utf-8 text body (217 bytes, message/rfc822)
2015-07-29 21:50 UTC, Raúl
Details
Sample email with iso-8859-1 text body (Content-Type UTF-8) (212 bytes, message/rfc822)
2015-07-29 21:57 UTC, Raúl
Details
Sample email with iso-8859-1 text body (No Content-Type specified) (172 bytes, message/rfc822)
2015-07-29 21:57 UTC, Raúl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raúl 2015-07-29 21:49:58 UTC
I have an email source in a text file. I use kmail --view <file name w/absolute path> to open it in a composer.
Even "Content-Type" header specifies UTF-8 charset, kmail composer is unable to cope with encoding, showing ugly characters instead of the right ones.

Reproducible: Always

Steps to Reproduce:
1. Download attached sample-email file
2. kmail --view $(pwd)/sample-email


Actual Results:  
Non-ascii characters, like 'á' are not shown properly

Expected Results:  
Non-ascii characters, like 'á' are shown properly

Debian unstable with kdepim and kdepimlibs from experimental. Plasma-desktop from KF5
Versions:
kdepim 4.14.5
kdepimlibs 4.14.6
kdelibs 4.14.2
qt4 4.8.7
qt5 5.4.2
kf5 5.12.0
Comment 1 Raúl 2015-07-29 21:50:55 UTC
Created attachment 93796 [details]
Sample email with utf-8 text body
Comment 2 Raúl 2015-07-29 21:57:06 UTC
Created attachment 93797 [details]
Sample email with iso-8859-1 text body (Content-Type UTF-8)
Comment 3 Raúl 2015-07-29 21:57:57 UTC
Created attachment 93798 [details]
Sample email with iso-8859-1 text body (No Content-Type specified)
Comment 4 Raúl 2015-07-29 22:14:23 UTC
Interestingly enough, I have the following results using "kmail --view" with these attached files:
- Sample email with iso-8859-1 text body (Content-Type UTF-8): Shown correctly, even Content-Type is wrongly specified as charset=UTF-8
- Sample email with iso-8859-1 text body (No Content-Type specified): Shown incorrectly.

I have tested Kmail preferences -> composer -> charset with default "us-ascii" as first option and prioritizing utf-8 (either as system locale or forced) with no differences in behaviour. 

Also when opening email file, I have tested changing encoding in view->set encoding. Default is auto, but trying utf-8 works for any of the iso-8859-1 encoded files. For utf-8 email, choosing utf-8 encoding in the view menu does not work and any other worsen things.

Doing kmail --view would be a typical use case when I want to send a git format-patch generated file.

I have experience this wrong behaviour since a long time ago. Only that I hadn't reported it. Also, I used to convert files to iso-8859-1 to sort out the issue.
Comment 5 Bao Haojun 2016-02-17 03:37:33 UTC
I have the same problem, and found a workaround for it:

http://baohaojun.github.io/blog/2016/02/17/0-kmail---view-cant-display-some-maildir-files-correctly.html
Comment 6 Justin Zobel 2021-03-11 01:23:51 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.