summaryrefslogtreecommitdiffstats
path: root/tdeabc/vcardformatplugin.cpp
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2016-05-29 02:31:06 +0200
committerSlávek Banko <slavek.banko@axis.cz>2016-05-29 02:31:18 +0200
commit940df2a98619f0dbb92dcd8d0024eaa2670b75fb (patch)
tree6288fd430eb0330f853dc2ebfbdc3d7b7f85ea77 /tdeabc/vcardformatplugin.cpp
parent0e05fd42f27ce265719d6e805786ce618263a270 (diff)
downloadtdelibs-940df2a98619f0dbb92dcd8d0024eaa2670b75fb.tar.gz
tdelibs-940df2a98619f0dbb92dcd8d0024eaa2670b75fb.zip
Fix utf8 support in tdeabc vCard parser
This resolves bug 2625 Signed-off-by: Emanoil Kotsev <deloptes@gmail.com> (cherry picked from commit 4ceb2b158b3ed1ba1c78ab886b08a0bf40577d51)
Diffstat (limited to 'tdeabc/vcardformatplugin.cpp')
-rw-r--r--tdeabc/vcardformatplugin.cpp16
1 files changed, 12 insertions, 4 deletions
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