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:06 +0200
commit4ceb2b158b3ed1ba1c78ab886b08a0bf40577d51 (patch)
tree4a848e8523433e697f2172ade0fcc1b845ded1ef /tdeabc/vcardformatplugin.cpp
parent51efac909d7b116c8b0ca58fcd4e74ff58f31091 (diff)
downloadtdelibs-4ceb2b158b3ed1ba1c78ab886b08a0bf40577d51.tar.gz
tdelibs-4ceb2b158b3ed1ba1c78ab886b08a0bf40577d51.zip
Fix utf8 support in tdeabc vCard parser
This resolves bug 2625 Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
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