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

List:       kde-commits
Subject:    KDE/kdepimlibs/kioslave/imap4
From:       Thiago Macieira <thiago () kde ! org>
Date:       2009-05-12 22:59:30
Message-ID: 1242169170.874110.7072.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 967224 by thiago:

Fix encoding issues introduced by r964857.

Before that commit, the KIMAP::decodeImapFolderName function took a
QByteArray (containing modified UTF-7) and returned a properly-encoded
UTF-16 QString.

That commit changed the function and added an overload: the one that
takes a QByteArray returns now a UTF-8 encoded QByteArray, whereas the
version that takes a QString returns a properly encoded QString.

This commit broke all the calls to decodeImapFolderName which passed a
QByteArray as a parameter and assigned the result to a QString (which
is to say, most of them, because that's the old function
signature).

Since QT_NO_CAST_FROM_ASCII is not enabled, the QByteArray
overload is called, which returns a UTF-8 encoded QByteArray, which is
then passed to the QString constructor, which decodes it as Latin 1.
Result: everything is doubly-UTF-8 encoded.

Please review all uses of decodeImapFolderName for this wrong
behaviour.

CCMAIL: ervin@kde.org

 M  +2 -2      imaplist.cpp  
 M  +1 -1      imapparser.cpp  


--- trunk/KDE/kdepimlibs/kioslave/imap4/imaplist.cpp #967223:967224
@@ -102,10 +102,10 @@
   s.pos++;  // tie off )
   parser_->skipWS (s);
 
-  hierarchyDelimiter_ = parser_->parseOneWord(s);
+  hierarchyDelimiter_ = QString::fromLatin1 (parser_->parseOneWord(s));
   if (hierarchyDelimiter_ == "NIL")
     hierarchyDelimiter_.clear();
-  name_ = KIMAP::decodeImapFolderName (parser_->parseLiteral (s));  // decode \
modified UTF7 +  name_ = QString::fromUtf8 (KIMAP::decodeImapFolderName \
(parser_->parseLiteral (s)));  // decode modified UTF7  }
 
 void imapList::parseAttributes( parseString & str )
--- trunk/KDE/kdepimlibs/kioslave/imap4/imapparser.cpp #967223:967224
@@ -685,7 +685,7 @@
   skipWS (result);
 
   this_one.setHierarchyDelimiter(parseLiteral(result));
-  this_one.setName (KIMAP::decodeImapFolderName( parseLiteral(result)));  // decode \
modified UTF7 +  this_one.setName(QString::fromUtf8(KIMAP::decodeImapFolderName( \
parseLiteral(result))));  // decode modified UTF7  
   listResponses.append (this_one);
 }


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

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