summaryrefslogtreecommitdiffstats
path: root/libtdepim/tdeabcresourcecached.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-05-29 02:41:19 +0200
committerSlávek Banko <slavek.banko@axis.cz>2016-05-29 02:41:37 +0200
commit0eeab90efa2797795e9155b16debc4203f463c51 (patch)
tree344e108abc16161e6784d1fcc57c26f27211d1c9 /libtdepim/tdeabcresourcecached.cpp
parent12ab541ee6de290277de72cb82072ebd52525b1c (diff)
downloadtdepim-0eeab90efa2797795e9155b16debc4203f463c51.tar.gz
tdepim-0eeab90efa2797795e9155b16debc4203f463c51.zip
Fix utf8 handling in tdeabc resource cache
This relates to bug 2625 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 85a02f7b0d1cbc92ea4273443bb95a652a5ad8ab)
Diffstat (limited to 'libtdepim/tdeabcresourcecached.cpp')
-rw-r--r--libtdepim/tdeabcresourcecached.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libtdepim/tdeabcresourcecached.cpp b/libtdepim/tdeabcresourcecached.cpp
index 5cae5882d..42a06e45b 100644
--- a/libtdepim/tdeabcresourcecached.cpp
+++ b/libtdepim/tdeabcresourcecached.cpp
@@ -217,7 +217,9 @@ void ResourceCached::loadCache()
#if defined(KABC_VCARD_ENCODING_FIX)
TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() );
#else
- TDEABC::Addressee::List list = converter.parseVCards( file.readAll() );
+ TQTextStream s( &file );
+ s.setEncoding( TQTextStream::UnicodeUTF8 );
+ TDEABC::Addressee::List list = converter.parseVCards( s.read() );
#endif
TDEABC::Addressee::List::Iterator it;
@@ -271,7 +273,9 @@ void ResourceCached::cleanUpCache( const TDEABC::Addressee::List &addrList )
#if defined(KABC_VCARD_ENCODING_FIX)
TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() );
#else
- TDEABC::Addressee::List list = converter.parseVCards( file.readAll() );
+ TQTextStream s( &file );
+ s.setEncoding( TQTextStream::UnicodeUTF8 );
+ TDEABC::Addressee::List list = converter.parseVCards( s.read() );
#endif
TDEABC::Addressee::List::Iterator cacheIt;
TDEABC::Addressee::List::ConstIterator it;
@@ -393,7 +397,9 @@ void ResourceCached::loadChangesCache( TQMap<TQString, TDEABC::Addressee> &map,
#if defined(KABC_VCARD_ENCODING_FIX)
const TDEABC::Addressee::List list = converter.parseVCardsRaw( file.readAll().data() );
#else
- const TDEABC::Addressee::List list = converter.parseVCards( file.readAll() );
+ TQTextStream s( &file );
+ s.setEncoding( TQTextStream::UnicodeUTF8 );
+ const TDEABC::Addressee::List list = converter.parseVCards( s.read() );
#endif
TDEABC::Addressee::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it )