Hi, can someone (Lars?) please examine the kdelibs part of this posting. For me that change didn't help to display japanese with qt-2.2.3, or do I= =20 need qt-copy for that? Regards, Michael H=E4ckel ---------- Forwarded Message ---------- Subject: Bug#19440: KMail and Japanese. Date: 31 Jan 2001 04:13:33 -0000 From: toyohiro@ksmplus.com To: submit@bugs.kde.org Package: kmail Version: cvs, Jan 29 2001 Severity: wishlist OS Debian Gnu/Linux 2.2 (potato) I got the these files from CVS server at Jan 29 2001, (qt-copy , kdesupport , kdelibs , kdebase , kdenetwork) and used kde-i18n-ja-2.1-beta2.tar.bz2( Message File) . I compiled these files and tested about Japanese Message. I tried to make a few patch for header charset which used in Japan. Please examine it. I am sorry , and The explanation might be insufficient. Because I speak english a little. (A) Please execute kcontrol. Fig-1 http://www.ksmplus.com/~toyohiro/kde2.1/kcon1.gif Please select Personalization -> Country & Language Country : Asia & Oceania -> "Japan(jp)" Language : "Japanese(ja)" Charset : "jisx0208.1983-0" Please click "Apply" button and "OK" button and File -> Quit. Fig-2 http://www.ksmplus.com/~toyohiro/kde2.1/kcon2.gif Please execute kcontrol again. The message did not display in Japanes= e. Fig-3 http://www.ksmplus.com/~toyohiro/kde2.1/kcon3.gif Please apply below patch and install to $KDE/share/config/charsets. and execute kcontrol again. The message displayed in Japanese. Fig-4 http://www.ksmplus.com/~toyohiro/kde2.1/kcon4.gif $cd SOURCES/kdelibs/kdecore $diff -u charsets.config.orig charsets.config --- charsets.config.orig Tue Jan 30 11:20:22 2001 +++ charsets.config Tue Jan 30 11:22:39 2001 @@ -68,6 +68,13 @@ x-cp-1257=3Dcp 1257 tis620=3Diso 8859-11 tis-620=3Diso 8859-11 +jisx0201.1976-0=3Deucjp +jisx0208.1983-0=3Deucjp +jisx0208.1990-0=3Deucjp +jisx0208.1997-0=3Deucjp +jisx0212.1990-0=3Deucjp +jisx0213.2000-1=3Deucjp +jisx0213.2000-2=3Deucjp windows-874=3Diso 8859-11 windows874=3Diso 8859-11 x-windows-874=3Diso 8859-11 (B) Please eucjp and sjis and iso2022jp files save to $HOME/Mail The files of eucjp , sjis and iso2022jp is in http://www.ksmplus.com/~toyohiro/kde2.1/eucjp http://www.ksmplus.com/~toyohiro/kde2.1/sjis http://www.ksmplus.com/~toyohiro/kde2.1/iso2022jp File of eucjp is raw mail data which used "eucjp" mail header charset= =2E File of sjis is raw mail data which used "shift_jis" . File of iso2022jp is raw mail data which used "iso-2022-jp" . and Please see also Fig-0 http://www.ksmplus.com/~toyohiro/kde2.1/japanese.gif (B-1) EUCJP charset. Please execute kmail and select eucjp in folder. The message displayed in Japanese. It is very fine. Fig-1 http://www.ksmplus.com/~toyohiro/kde2.1/kmail1.gif (B-2) SJIS charset. Please select sjis in folder. The message did not display in Japanese. Fig-2 http://www.ksmplus.com/~toyohiro/kde2.1/kmail2.gif Please apply below patch and re-compile and execuete kmail again. Please select sjis in folder, the message displayed in Japanese. Fig-3 http://www.ksmplus.com/~toyohiro/kde2.1/kmail3.gif I think , When QT-2.2.4 is released , This patch is not necessary. Because another person reported to Trolltech about QTextCodec. diff -ur kmail.orig/kmmsgbase.cpp kmail/kmmsgbase.cpp --- kmail.orig/kmmsgbase.cpp Wed Jan 3 00:30:16 2001 +++ kmail/kmmsgbase.cpp Tue Jan 30 12:04:37 2001 @@ -372,6 +372,9 @@ // decode base64 text cstr =3D decodeBase64(str); } +#if QT_VERSION < 224 + if(QString(charset).lower() =3D=3D "shift_jis" || + QString(charset).lower() =3D=3D "shift-jis= " ) + charset =3D"sjis"; // toyo +#endif QTextCodec *codec =3D codecForName(charset); if (!codec) codec =3D codecForName(KGlobal::locale()->charset()); if (codec) str =3D codec->toUnicode(cstr); diff -ur kmail.orig/kmreaderwin.cpp kmail/kmreaderwin.cpp --- kmail.orig/kmreaderwin.cpp Fri Jan 26 06:46:28 2001 +++ kmail/kmreaderwin.cpp Tue Jan 30 13:00:58 2001 @@ -518,6 +518,8 @@ encoding =3D msgPart.charset(); } } +#if QT_VERSION < 224 + if( encoding.lower() =3D=3D "shift_jis" || encoding.lower() =3D=3D "= shift-jis" ) + encoding =3D "sjis"; // toyo +#endif if (encoding.isEmpty()) encoding =3D "iso8859-1"; mCodec =3D KMMsgBase::codecForName(encoding); (B-3) ISO-2022-JP charset. Please select iso2022jp in folder. The messages did not display in Japanese. Fig-4 http://www.ksmplus.com/~toyohiro/kde2.1/kmail4.gif Please apply below patch and re-compile and execuete kmail again. Please select iso2022jp in folder, the message displayed in Japanese. Fig-4 http://www.ksmplus.com/~toyohiro/kde2.1/kmail5.gif diff -ur kmail.orig/kmmessage.cpp kmail/kmmessage.cpp --- kmail.orig/kmmessage.cpp Tue Jan 23 17:11:30 2001 +++ kmail/kmmessage.cpp Tue Jan 30 12:07:56 2001 @@ -255,7 +255,10 @@ resultPos =3D (char*)result.data(); if (strPos) for (; (ch=3D*strPos)!=3D'\0'; strPos++) { - if ((ch>=3D' ' || ch=3D=3D'\t' || ch=3D=3D'\n' || ch<=3D'\0') +// Mail header charset(iso-2022-jp) is using all most E-mail system in Japan. +// ISO-2022-JP code consists of ESC(0x1b) character and 7Bit character which +// used from '!' character to '~' character. toyo + if ((ch>=3D' ' || ch=3D=3D'\t' || ch=3D=3D'\n' || ch<=3D'\0' || ch =3D= =3D '\033' ) && !(ch=3D=3D'>' && aStr.mid(strPos-aStr.data()-1,6)=3D=3D"\n>Fro= m")) *resultPos++ =3D ch; } When quotedHTML function by the "ISO-2022-JP" character execute before mCodec-toUnicode function. quotedHTML function mistake. because the "ISO-2022-JP" character which included '<' ,'>' , '&' and ... character. diff -ur kmail.orig/kmreaderwin.cpp kmail/kmreaderwin.cpp --- kmail.orig/kmreaderwin.cpp Fri Jan 26 06:46:28 2001 +++ kmail/kmreaderwin.cpp Tue Jan 30 13:00:58 2001 @@ -904,6 +907,12 @@ } // if (!pgpMessage) then the message only looked similar to a pgp message else htmlStr =3D mCodec->toUnicode(quotedHTML(aStr)); } +// Mail header charset(iso-2022-jp) is using all most E-mail system in Japan. +// ISO-2022-JP code consists of ESC(0x1b) character and 7Bit character which +// used from '!' character to '~' character. +// JIS7 is header charset of iso-2022-jp. toyo + else if( QString(mCodec->name()) =3D=3D "JIS7" ) + htmlStr +=3D quotedHTML(mCodec->toUnicode(aStr)); else htmlStr +=3D mCodec->toUnicode(quotedHTML(aStr)); mViewer->write(htmlStr); } (C) Please get the addressbook file and save to $HOME/.kde/share/apps/addressbook. addressbook file is in http://www.ksmplus.com/~toyohiro/kde2.1 Please execute kmail and push AddressBook button. Fig-1 http://www.ksmplus.com/~toyohiro/kde2.1/addressbook.gif Please Composer button -> click "To:" field . and press Control-Key + Left-arrow-Key and display the contents of addressbook. The messages did not display in Japanese. Fig-2 http://www.ksmplus.com/~toyohiro/kde2.1/composer1.gif Please apply below patch and re-compile and execuete kmail again. Please Composer button -> click "To:" field . and press Control-Key + Left-arrow-Key and display the contents of addressbook. The messages displayed in Japanese. Fig-3 http://www.ksmplus.com/~toyohiro/kde2.1/composer2.gif diff -ur kmail.orig/kmcomposewin.cpp kmail/kmcomposewin.cpp --- kmail.orig/kmcomposewin.cpp Sat Jan 27 04:31:57 2001 +++ kmail/kmcomposewin.cpp Tue Jan 30 12:14:33 2001 @@ -2427,7 +2427,8 @@ n=3D0; if (!KMAddrBookExternal::useKAB()) - for (QString a=3Dadb.first(); a; a=3Dadb.next()) + for (QString a=3DQString::fromLocal8Bit(adb.first()) + ; a; a=3DQString::fromLocal8Bit(adb.next())) { if (QString(a).find(s,0,false) >=3D 0) { Best Regards, Toyohiro (submitted via bugs.kde.org) _______________________________________________ Kmail Developers mailing list Kmail@master.kde.org http://master.kde.org/mailman/listinfo/kmail -------------------------------------------------------