Bug 56570

Summary: kmail doesn't show non-mime Japanese message
Product: [Applications] kmail Reporter: Takumi ASAKI <takumi>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Takumi ASAKI 2003-03-29 06:13:09 UTC
Version:           1.5.9 (using KDE 3.1.9)
Compiler:          gcc version 3.2.2
OS:          Linux (i686) release 2.4.20-0vl14

KMail CVS-HEAD can't show non-MIME Japanese message when auto-detect codec.

In Japan, default mail codec is ISO-2022-jp (JIS7).
(locale codec is EUCJP).

So KMail has KMKernel::networkCodec() as default message Codec.

KDE-3.0 or KDE-3.1 show non-MIME Japanese message correctly.
but CVS-HEAD seems to do not use KMKernel::networkCodec().
I need set Encoding to ISO-2022-JP.

Please use KMKernel::networkCodec() as default codec for non-MIME mail.
Comment 1 Toyohiro Asukai 2003-03-30 20:05:45 UTC
Hi ,

I think that if "charsets" of mail header does not
define (same as non-mime mail) ,
I would like to use "kernel->networkCodec" functions.
Because the function of "kernel->networkCodec" return
to suitable locale codec. 

Please check below patch.

$diff -u kmmsgpart.cpp.org kmmsgpart.cpp
--- kmmsgpart.cpp.org   Mon Mar  3 04:07:43 2003
+++ kmmsgpart.cpp       Mon Mar 31 02:22:21 2003
@@ -6,6 +6,7 @@
 #include <kdebug.h>
 #include <kmdcodec.h>
 
+#include "kmglobal.h"
 #include "kmmsgpart.h"
 #include "kmmessage.h"
 
@@ -293,7 +294,8 @@
 const QTextCodec * KMMessagePart::codec() const {
   QTextCodec * c = KMMessage::codecForName( charset() );
   if ( !c )
-    c = QTextCodec::codecForName("iso-8859-1");
+//    c = QTextCodec::codecForName("iso-8859-1");
+    c = kernel->networkCodec();
   assert( c );
   return c;
 }

--
Toyohiro Asukai <toyohiro@ksmplus.com>
Comment 2 Ingo Kl 2003-03-31 23:59:59 UTC
Subject: kdepim/kmail

CVS commit by kloecker: 

Fix bug 56570: kmail doesn't show non-mime Japanese message

Default to local encoding if no charset is specified for a message part. Patch by Toyohiro Asukai <toyohiro@ksmplus.com>

CCMAIL: 56570-fixed@bugs.kde.org


  M +4 -1      kmmsgpart.cpp   1.99


--- kdepim/kmail/kmmsgpart.cpp  #1.98:1.99
@@ -9,4 +9,5 @@
 #include "kmmsgpart.h"
 #include "kmmessage.h"
+#include "kmkernel.h"
 
 #include <kmime_charfreq.h>
@@ -72,5 +73,7 @@ const QTextCodec * KMMessagePart::codec(
   const QTextCodec * c = KMMessage::codecForName( charset() );
   if ( !c )
-    c = QTextCodec::codecForName("iso-8859-1");
+    // no charset means us-ascii (RFC 2045), so using local encoding should
+    // be okay
+    c = kernel->networkCodec();
   assert( c );
   return c;