Version: (using KDE KDE 3.3.2) Installed from: SuSE RPMs OS: Linux In this example the system char encoding is set to utf-8. If you open a mail encoded in a different charset, say iso-8859-15, the special characters in the mail are not displayed correctly. Kmail displays them in the system charset which obviously doesn't work. The broken code seems to be (taken from CVS) here: kmcommands.cpp: void KMOpenMsgCommand::slotResult( KIO::Job *job ) KMMessage *msg = new KMMessage( dwMsg ); msg->setReadyToShow( true ); KMReaderMainWin *win = new KMReaderMainWin(); win->showMsg( kmkernel->networkCodec(), msg ); This means the networkCodec is used but not the encoding stated in the Content-Type: charset= header of the mail or the codec fallback system (which has been introduced recently to fix #84702)
CVS commit by tilladam: Don't hardcode the use of the network codec when opening a mail from a file but rather use the one the mail specifies or the fallback encoding. BUG: 100834 M +5 -3 kmcommands.cpp 1.201 M +3 -1 kmcommands.h 1.62 M +1 -1 kmmainwidget.cpp 1.323 --- kdepim/kmail/kmcommands.cpp #1.200:1.201 @@ -882,7 +882,9 @@ void KMSaveMsgCommand::slotSaveResult(KI //----------------------------------------------------------------------------- -KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url ) +KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url, + const QTextCodec *codec ) : KMCommand( parent ), - mUrl( url ) + mUrl( url ), + mCodec( codec ) { setDeletesItself( true ); @@ -973,5 +975,5 @@ void KMOpenMsgCommand::slotResult( KIO:: msg->setReadyToShow( true ); KMReaderMainWin *win = new KMReaderMainWin(); - win->showMsg( kmkernel->networkCodec(), msg ); + win->showMsg( mCodec, msg ); win->show(); if ( multipleMessages ) --- kdepim/kmail/kmcommands.h #1.61:1.62 @@ -332,5 +332,6 @@ class KDE_EXPORT KMOpenMsgCommand : publ public: - KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL() ); + KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL(), + const QTextCodec *codec = 0 ); private: @@ -346,4 +347,5 @@ private: DwString mMsgString; KIO::TransferJob *mJob; + const QTextCodec *mCodec; }; --- kdepim/kmail/kmmainwidget.cpp #1.322:1.323 @@ -1587,5 +1587,5 @@ void KMMainWidget::slotSaveMsg() void KMMainWidget::slotOpenMsg() { - KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this ); + KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this, 0, mCodec ); openCommand->start();
CVS commit by kloecker: Backport CVS commit by tilladam: Don't hardcode the use of the network codec when opening a mail from a file but rather use the one the mail specifies or the fallback encoding. CCBUG: 100834 M +5 -3 kmcommands.cpp 1.197.2.1 M +3 -1 kmcommands.h 1.61.2.1 M +1 -1 kmmainwidget.cpp 1.320.2.2 --- kdepim/kmail/kmcommands.cpp #1.197:1.197.2.1 @@ -868,7 +868,9 @@ void KMSaveMsgCommand::slotSaveResult(KI //----------------------------------------------------------------------------- -KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url ) +KMOpenMsgCommand::KMOpenMsgCommand( QWidget *parent, const KURL & url, + const QTextCodec *codec ) : KMCommand( parent ), - mUrl( url ) + mUrl( url ), + mCodec( codec ) { setDeletesItself( true ); @@ -959,5 +961,5 @@ void KMOpenMsgCommand::slotResult( KIO:: msg->setReadyToShow( true ); KMReaderMainWin *win = new KMReaderMainWin(); - win->showMsg( kmkernel->networkCodec(), msg ); + win->showMsg( mCodec, msg ); win->show(); if ( multipleMessages ) --- kdepim/kmail/kmcommands.h #1.61:1.61.2.1 @@ -332,5 +332,6 @@ class KDE_EXPORT KMOpenMsgCommand : publ public: - KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL() ); + KMOpenMsgCommand( QWidget *parent, const KURL & url = KURL(), + const QTextCodec *codec = 0 ); private: @@ -346,4 +347,5 @@ private: DwString mMsgString; KIO::TransferJob *mJob; + const QTextCodec *mCodec; }; --- kdepim/kmail/kmmainwidget.cpp #1.320.2.1:1.320.2.2 @@ -1587,5 +1587,5 @@ void KMMainWidget::slotSaveMsg() void KMMainWidget::slotOpenMsg() { - KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this ); + KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( this, 0, mCodec ); openCommand->start();
You need to log in before you can comment on or make changes to this bug.