From 4ceb2b158b3ed1ba1c78ab886b08a0bf40577d51 Mon Sep 17 00:00:00 2001 From: Emanoil Kotsev Date: Sun, 29 May 2016 02:31:06 +0200 Subject: Fix utf8 support in tdeabc vCard parser This resolves bug 2625 Signed-off-by: Emanoil Kotsev --- tdeabc/vcardformatplugin.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tdeabc/vcardformatplugin.cpp') diff --git a/tdeabc/vcardformatplugin.cpp b/tdeabc/vcardformatplugin.cpp index 2adb7e139..7032b3ee6 100644 --- a/tdeabc/vcardformatplugin.cpp +++ b/tdeabc/vcardformatplugin.cpp @@ -41,7 +41,7 @@ bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) TQString data; TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); data = t.read(); VCardConverter converter; @@ -60,7 +60,7 @@ bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file TQString data; TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); data = t.read(); VCardConverter converter; @@ -88,7 +88,11 @@ void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) TQTextStream t( file ); t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); + TQString text = converter.createVCards( vcardlist ); +// kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl; +// kdDebug(5700)<< text << endl; +// kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl; + t << text; } void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file ) @@ -104,7 +108,11 @@ void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file TQTextStream t( file ); t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); + TQString text = converter.createVCards( vcardlist ); +// kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl; +// kdDebug(5700)<< text << endl; +// kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl; + t << text; } bool VCardFormatPlugin::checkFormat( TQFile *file ) const -- cgit v1.2.1