Bug 65766 - Use fallback character encoding also for the subject
Summary: Use fallback character encoding also for the subject
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kmail
Classification: Applications
Component: mime (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-09 21:03 UTC by Olivier Fisette
Modified: 2012-08-19 00:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example ISO encoded message whose subject line contains no ASCII chars (4.18 KB, text/plain)
2003-10-10 17:58 UTC, Olivier Fisette
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Fisette 2003-10-09 21:03:54 UTC
Version:           1.5.4 (using KDE KDE 3.1.4)
Installed from:    Gentoo Packages
Compiler:          GNU C Compiler 3.2.3 
OS:          Linux

When I receive an ISO-8859-15 encoded message and my UNIX locale is set to use the Unicode encoding, KMail displays the body of the message (in the message pane) using ISO-8859-15, but it uses Unicode to display the subject (in the messages list pane and the message pane), without first converting the subject string from ISO-8859-15 to Unicode, resulting in garbled characters. Interestingly, if I choose to show all headers in the message pane, KMail seems to use the same encoding for the headers and the body, so the subject line appears correctly.

I would expect KMail to assume the subject line uses the same encoding as the body, and to convert between this encoding and Unicode before displaying the line.

Here is an example of what happens :

MandrakeSoft r?ompens?pour le Club et la 9.1
(subject line with garbled accented characters)

MandrakeSoft r
Comment 1 Stephan Kulow 2003-10-10 07:42:43 UTC
are you using IMAP? Can you attach an example mail?  
Comment 2 Thiago Macieira 2003-10-10 16:17:38 UTC
Another question: what do you mean by "Unicode locale"? A locale like fr_CA.UTF-8? 
Comment 3 Olivier Fisette 2003-10-10 17:58:15 UTC
Created attachment 2733 [details]
Example ISO encoded message whose subject line contains no ASCII chars

I use a POP3 account. My POSIX locale is set to fr_CA.UTF-8, as is my XFree86
locale. An example mail is attached. As you can appreciate, all non-ascii
characters get garbled since they are ISO encoded but interpreted as if they
were Unicode encoded.
Comment 4 Olivier Fisette 2003-10-10 17:59:16 UTC
Typo in comment #3 : ...  contains non-ASCII chars 
Comment 5 Thiago Macieira 2003-10-11 00:04:58 UTC
The e-mail is invalid. Please have the source fix their mailer. KMail is not at fault here. 
 
Your Subject line comes in this header in your e-mail: 
Subject: Mandrake Newsletter Flash: MandrakeSoft r
Comment 6 Marc Mutz 2003-10-11 13:01:57 UTC
The reason for using ::fromLocal8Bit() is that it works for most Asian people. A config option to 
choose the fallback charset for headers as well as bodies would be nice, but it's a wish, not a 
bug. 
Comment 7 Thiago Macieira 2003-10-11 21:43:20 UTC
An option to configure a violation of the standards? The subject is supposed to be 
US-ASCII and KMail already is graceful enough to tolerate those violations. 
Comment 8 Stephan Kulow 2003-10-11 22:21:11 UTC
well, it's already used for the body, why exclude the headers from it? 
People won't stop creating broken mails too soon ;( [bugs.kde.org is 
just another bad example, btw] 
Comment 9 Ingo Klöcker 2003-10-12 01:20:10 UTC
Subject: Re:  Incorrect encoding is assumed when displaying messages subjects

The body is allowed to contain non-US-ASCII characters (at least if cte 
is 8bit). The headers OTOH must never contain anything else than 
US-ASCII characters (0x01 - 0x7F).
Comment 10 Olivier Fisette 2003-10-12 05:01:43 UTC
I know the mail violates the RFC. What I pointed out is that since KMail detects (or 
falls back) to a correct encoding, it might as well do so for the entire mail rather than 
only for the body. 
 
Even if the subject line is not supposed to include non-ASCII characters, many 
clients do make this mistake. I understand it's not the developers job to find 
workarounds for mistakes in other people's applications, but since the feature is 
already there, it would be nice and perhaps not too much work to extend it a little. In 
any case, it would make KMail behave the way the end-user expects it. An average 
user is not going to suppose the message is incorrectly formed, he is going to 
assume KMail is buggy, and that would be sad, since it's not the case. The best 
would certainly be to have a default configurable fallback encoding that would apply 
both to the Subject and From fields and to the body. 
Comment 11 Thiago Macieira 2003-10-12 07:51:06 UTC
Unless it is made configurable, you're asking us to replace a feature that already violates 
the standards with another feature that still violates them and would break support for (also 
broken) asian-language e-mails. 
 
In any event, be sure to warn the source about their problem. A less forgiving MTA or MDA 
could simply decide to drop those characters that were not well protected, as was my case 
with my ISP in France. 
 
So, it's up to the KMail developers to decide whether they will implement this feature, but 
note that it should not come before KDE 3.2 (we're in feature-list freeze already). 
Comment 12 maxcz 2004-05-07 18:03:35 UTC
I have the same problem, too.
I live in Austria and many clients seem to transmit "umlaute" as 8-bit-characters in the headers, especially auto-generated mails from web services (like EBay and my Chello newsletter etc.).
Strange thing is, before I updated to SuSE 9.1 from 8.0, those characters were shown correctly.
But maybe this is due to the change of the default charset for SuSE 9.1 to UTF-8?
Is there something I can do about it?
Comment 13 Ingo Klöcker 2005-05-16 15:42:47 UTC
Since KMail 1.8 it's possible to define a fallback character encoding that's used for messages which are lacking an explicitly mentioned character encoding. This fallback should also be used for the subject.
Comment 14 David Lee 2007-01-31 10:01:47 UTC
The fallback encoding (or manually set encoding, for that matter) does not seem to be applied to the subject of a message. Was this ever implemented?
Comment 15 Myriam Schweingruber 2012-08-18 08:25:01 UTC
Thank you for your feature request. Kmail1 is currently unmaintained so we are closing all wishes. Please feel free to reopen a feature request for Kmail2 if it has not already been implemented.
Thank you for your understanding.
Comment 16 Luigi Toscano 2012-08-19 00:59:48 UTC
Instead of creating a new feature request, please confirm here if the wishlist is still valid for kmail2.