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

List:       kde-pim
Subject:    [Kde-pim] [PATCH] fix loss of encoding when importing vcards
From:       Till Adam <adam () kde ! org>
Date:       2005-06-09 17:57:25
Message-ID: 200506092011.09926.adam () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


Heya folks, and especially Tobias,

attached patch fixes encoding problems when importing vcards (exported 
correctly by KAddressbook itself.) I'm not sure that this is the correct fix, 
but apparently the codec detection finds something wrong, where it should 
treat the stuff as utf8. Please review.

Till

["kaddressbook-export-import-encoding-bug.diff" (text/x-diff)]

Index: xxport/vcard_xxport.cpp
===================================================================
--- xxport/vcard_xxport.cpp	(revision 422834)
+++ xxport/vcard_xxport.cpp	(working copy)
@@ -196,12 +196,13 @@
           QByteArray rawData = file.readAll();
           file.close();
           if ( rawData.size() > 0 ) {
+            QString data;
+            /*
             QTextCodec *codec = QTextCodec::codecForContent( rawData.data(), 50 );
-
-            QString data;
             if ( codec )
               data = codec->toUnicode( rawData.data(), rawData.size() );
             else
+            */
               data = QString::fromUtf8( rawData.data(), rawData.size() );
 
             addrList += parseVCard( data );

[Attachment #8 (application/pgp-signature)]

_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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