[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: charset="ks_c_5601-1987" not supported?
From:       Waldo Bastian <bastian () kde ! org>
Date:       2001-10-22 3:53:57
[Download RAW message or body]

On Sunday 21 October 2001 01:05 am, Michael Häckel wrote:
bastian@kde.org | SuSE Labs KDE Developer | bastian@suse.com
-- > On Sunday 21 October 2001 06:41, Waldo Bastian wrote:
> > See, spam can be usefull at times. It struck me that the attached spam
> > that was send to the kde-i18n-doc list wasn't readable at all in kmail.
> >
> > The charset says "ks_c_5601-1987", when I select "euckr" as encoding it
> > seems to be much more readable. Unfortunately I can't read Korean, so I
> > can't judge whether that would indeed be correct.
>
> Well, we use QTextCodec::codecForName().
> Nevertheless, according to http://www.iana.org/assignments/character-sets
> ks_c_5601-1987 and euc-kr are different encodings and the second one is the
> preferred one for e-mails. Maybe they have an overlap, but I don't know.

Shouldn't we use KCharset::codecForName() instead? That one uses KDE's 
charsets.config in which ks_c_5601-1987 is listed as an alias for euckr.

See also 
http://lists.w3.org/Archives/Public/ietf-charsets/2001AprJun/0025.html
and especially the thread from 
http://lists.w3.org/Archives/Public/ietf-charsets/2001AprJun/0033.html
on. 

Patch attached. Please test.

Cheers,
Waldo
["kmail_charsets.patch" (text/x-diff)]

Index: kmmsgbase.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmsgbase.cpp,v
retrieving revision 1.91
diff -u -3 -d -p -r1.91 kmmsgbase.cpp
--- kmmsgbase.cpp	2001/10/11 14:14:59	1.91
+++ kmmsgbase.cpp	2001/10/22 03:45:05
@@ -3,6 +3,7 @@
 #include <kdebug.h>
 #include <kglobal.h>
 #include <klocale.h>
+#include <kcharsets.h>
 
 #include <mimelib/mimepp.h>
 #include <qregexp.h>
@@ -184,10 +185,7 @@ QString KMMsgBase::skipKeyword(const QSt
 QTextCodec* KMMsgBase::codecForName(const QCString& _str)
 {
   if (_str.isEmpty()) return NULL;
-  if (_str.lower() == "shift_jis" || _str.lower() == "shift-jis")
-    return QTextCodec::codecForName("sjis");
-  return QTextCodec::codecForName(_str.lower().replace(
-    QRegExp("windows"), "cp") );
+  return KGlobal::charsets()->codecForName(_str.lower());
 }
 
 

_______________________________________________
kmail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic