Bug 51180

Summary: changes underscores in spaces in quoted-printable attachments
Product: [Applications] kmail Reporter: Marco Rothley <m.rothley>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: CLOSED WORKSFORME    
Severity: normal CC: danarmak, konrad.rosenbaum, shift, styx
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandrake RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: kmime_codec_qp_v2.diff

Description Marco Rothley 2002-11-25 16:09:05 UTC
Version:            (using KDE KDE 3.0.99)
Installed from:    Mandrake RPMs
Compiler:          gcc 3.2 gcc 3.2 (Mandrake Linux 9.1 3.2-4mdk)
OS:          Linux

Underscores in quoted-printable encoded attachments are translated in spaces. This is the right thing for quoted-printable encoded header fields (often seen in Subject: Headers with non-ASCII characters) but not for attachments. I have seen this (wrong) behaviour with HTML Mails send by an MS Outlook client.
Earlier Versions did the Q-P conversion correctly.
Comment 1 Ingo Klöcker 2002-11-26 00:33:28 UTC
Subject: Re:  New: changes underscores in spaces in quoted-printable attachments

A week ago I could reproduce this on one machine. But after a complete 
rebuild of qt-copy and KDE the problem is gone. I have no idea what 
could have caused this problem and as I can't reproduce it anymore I 
have to assume that the problem has been fixed somehow in the meantime.


Comment 2 Marc Mutz 2002-11-27 00:49:44 UTC
Subject: Re:  changes underscores in spaces in quoted-printable
 attachments

On Tuesday 26 November 2002 23:31, you wrote:
<snip>
> Marc? Is it o.k. to commit this workaround?
<snip>

*beep* no patch *beep* :-D

Also not in bugzilla.

Ah, OK, found it. Is this causing a compile error or is it triggering a 
bug in gcc?

What's the bug exctly? That KMail produces ' ' -> '_' in QP attachments?
Or that it doesn't decode them?

The mQEncding flag is set by the ctor and then never written again. I 
don't see how that could affect anything.

A nice workaround is maybe to leave the const, but move the bool 
mQEncoding to before the bool : 1's and removing it's :1. maybe that's 
what causes gcc to miscompile?

If that doesn't help, then go ahead with the patch as it stands.
I will replace these conditionals with a variant of Strategy anyway 
(lookup table instead of class, though) when I get around to make the 
codec's text vs. binary aware.

Marc

Comment 3 Wolfgang Westphal 2002-11-27 09:26:05 UTC
Subject: Re:  changes underscores in spaces in quoted-printable attachments

Am Wednesday 27 November 2002 00:49 schrieb Marc Mutz:
> What's the bug exctly? That KMail produces ' ' -> '_' in QP attachments?
> Or that it doesn't decode them?

Underscores in QP message parts are decoded as spaces, so KMail produces 
'_' -> ' '.

> The mQEncding flag is set by the ctor and then never written again. I
> don't see how that could affect anything.

The problem is that it is set true, although false is passed to the 
constructor.

> A nice workaround is maybe to leave the const, but move the bool
> mQEncoding to before the bool : 1's and removing it's :1. maybe that's
> what causes gcc to miscompile?

Leaving it const and moving it up at first place works for me, no need to 
remove it's :1. Patch attached.

Regards,
Wolfgang
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE95IJgGoxYmT/KkJkRAj3gAKCILm+F9ulpaPgjQPHx3pMiazjytQCdFYNa
978JDpAOr8G3zSIZgWAAeHE=
=mSY3
-----END PGP SIGNATURE-----


Created an attachment (id=536)
kmime_codec_qp_v2.diff
Comment 4 Ingo Klöcker 2002-11-29 23:20:02 UTC
*** Bug 51344 has been marked as a duplicate of this bug. ***
Comment 5 Ingo Klöcker 2002-12-27 01:56:13 UTC
*** Bug 52328 has been marked as a duplicate of this bug. ***
Comment 6 Ingo Klöcker 2002-12-28 11:34:18 UTC
*** Bug 52328 has been marked as a duplicate of this bug. ***
Comment 7 Joachim Blaabjerg 2003-01-22 11:37:53 UTC
This is still a problem for me with KDE 3.1 (rc7/final somewhere), even though the  
attached patch has been applied in CVS a while ago. I'm using Gentoo Linux 1.4,  
here are the relevant pieces of information from `emerge info`:  
  
Portage 2.0.46-r9 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r3)  
=================================================================  
System uname: 2.4.20-wolk4.0s-pre7 i686 AMD Athlon(tm) XP 2000+  
COMPILER="gcc3"  
CHOST="i686-pc-linux-gnu"  
CFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe"  
CXXFLAGS="-march=athlon-xp -mcpu=athlon-xp -O3 -pipe"  
  
I believe this bug has caused a few unexplainably bad GnuPG signatures. Am I the 
only one who has this problem?