Bug 258936

Summary: Keep original charset option breaks with non ascii characters
Product: [Applications] kmail2 Reporter: Marc Schiffbauer <mschiff>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tokoe
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshot showing both: correct display while viewing and wrong display while editing mail
Example mail inmbox format

Description Marc Schiffbauer 2010-12-05 19:17:42 UTC
Created attachment 54176 [details]
Screenshot showing both: correct display while viewing and wrong display while editing mail

Version:           unspecified (using Devel) 
OS:                Linux

When viewing a message all non-ascii characters look ok.

When hitting reply, they will be mangle as can be seen in the attached screenshot.

Reproducible: Always

Steps to Reproduce:
* Sent a mail including non-ascii charcaters like üöä to yourself
* Hit reply on that message, see quoted text

Actual Results:  
non-ascii chars will get mangled

Expected Results:  
Correct character display

Please see attached screenshot
Comment 1 Tobias Koenig 2010-12-12 15:40:23 UTC
Hej Marc,

is the mail a multipart message?

Ciao,
Tobias
Comment 2 Marc Schiffbauer 2010-12-14 02:15:48 UTC
Hey Tobias,

it does not matter. It happens to plain text messages (plain/text) as well as to multipart messages (text/plain, text/html) for example
Comment 3 Marc Schiffbauer 2010-12-15 13:56:35 UTC
(In reply to comment #1)
> Hej Marc,
> 
> is the mail a multipart message?
> 
> Ciao,
> Tobias

Please see comment #2 - bug status changed back to UNCONFIRMED (as I am not allowed to set it to "NEW")
Comment 4 Torgny Nyblom 2010-12-18 08:08:16 UTC
I cannot reproduce this. Please reopen if you can using a version greater then svn r1205247.
Comment 5 Marc Schiffbauer 2010-12-18 17:58:28 UTC
(In reply to comment #4)
> I cannot reproduce this. Please reopen if you can using a version greater then
> svn r1205247.

What did you try? For it does not work. MAy some kmail2 setting cause that?

I have beta2 and recent svn kdepim running here (apart from that kmail does not build today... but did some days ago)

Why are you referring to r1205247?
Comment 6 Marc Schiffbauer 2010-12-19 15:53:52 UTC
After upgrading kdepimlibs again it seems to be fixed now! Thx.
Comment 7 Marc Schiffbauer 2010-12-19 16:34:29 UTC
OK, and now on another Mail it did NOT work anymore. So it seems to depend on the message and will not occur on all messages containing non-ascii chars.

But the issue is definitely not fixed in current svn (r1207742)

Hm, how can re-open the bug?

-Marc
Comment 8 Torgny Nyblom 2010-12-19 20:34:40 UTC
Could you attach a message that breaks for you (in mbox format if possible)?
Comment 9 Marc Schiffbauer 2010-12-20 03:06:49 UTC
Created attachment 55090 [details]
Example mail inmbox format
Comment 10 Torgny Nyblom 2010-12-20 07:50:46 UTC
I'm sorry but that mail works fine with my kmail.
Comment 11 Marc Schiffbauer 2010-12-20 13:40:08 UTC
What exactly did you do to test? Maybe some setting in kmail will cause this?
Which locale/language/encoding settings do you use?

I have:
Menu "Settings" -> configure kmail -> E-Mail-Editor -> Tab: Charset
 us-ascii
 iso-8859-1
 utf-8 (locale)
 utf-8

Menu "View" -> Set encoding -> Auto

In Email-Editor:
Menu "Options" -> Encoding -> Default

Any elde that might be relevant?

Did you really try to reply to that mail and not just display it?

Thanks
Marc
Comment 12 Marc Schiffbauer 2010-12-20 13:43:59 UTC
Update:

Try to enable following setting:

Menu "Settings" -> configure kmail -> E-Mail-Editor -> Tab: Charset
[X] Keep original charset when replying or forwarding (if possible)

I had this enabled. When I disable that setting it works as expected. So the "(if possible)" seems to be broken!
Comment 13 Torgny Nyblom 2010-12-20 19:28:44 UTC
Confirmed, it's the Keep option that is broken
Comment 14 Tobias Koenig 2010-12-21 10:24:29 UTC
SVN commit 1208340 by tokoe:

Fix conversion of charsets when replying/forwarding a message.

The msg->body() must be converted to unicode with the right codec
and not blindly with UTF-8.

BUG: 258936


 M  +16 -5     messagefactory.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1208340
Comment 15 Marc Schiffbauer 2010-12-21 13:37:37 UTC
Fix confirmed. Thanks!