summaryrefslogtreecommitdiffstats
path: root/tderesources/carddav
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-01-18 14:13:43 +0100
committerSlávek Banko <slavek.banko@axis.cz>2014-01-18 14:13:43 +0100
commit5a692370051844e966a42abcfc48beae75112539 (patch)
tree27d440e95022da3cc7f3a67c49a3eed5c344e4fc /tderesources/carddav
parentb415f1f1f41873febdad7448ad04648a148b1ad5 (diff)
downloadtdepim-5a692370051844e966a42abcfc48beae75112539.tar.gz
tdepim-5a692370051844e966a42abcfc48beae75112539.zip
Fix utf8 and html entities handling in CalDAV and CardDAV resources
Diffstat (limited to 'tderesources/carddav')
-rw-r--r--tderesources/carddav/reader.cpp3
-rw-r--r--tderesources/carddav/resource.cpp4
-rw-r--r--tderesources/carddav/writer.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/tderesources/carddav/reader.cpp b/tderesources/carddav/reader.cpp
index 5836bbccc..eb5625060 100644
--- a/tderesources/carddav/reader.cpp
+++ b/tderesources/carddav/reader.cpp
@@ -15,6 +15,7 @@
#include "reader.h"
#include <kdebug.h>
+#include <kcharsets.h>
#include <string>
/*=========================================================================
@@ -47,7 +48,7 @@ int CardDavReader::runJob(runtime_info* RT) {
if (OK == res) {
kdDebug() << "success" << '\n';
if (result->msg) {
- mData = result->msg;
+ mData = KCharsets::resolveEntities(TQString::fromUtf8(result->msg));
} else {
kdDebug() << "empty collection" << '\n';
// empty collection
diff --git a/tderesources/carddav/resource.cpp b/tderesources/carddav/resource.cpp
index c9993abb5..9fc54692e 100644
--- a/tderesources/carddav/resource.cpp
+++ b/tderesources/carddav/resource.cpp
@@ -425,7 +425,7 @@ bool ResourceCardDav::checkData(const TQString& data) {
TDEABC::VCardConverter converter;
bool ret = true;
TDEABC::VCardConverter conv;
- Addressee::List addressees = conv.parseVCards( data );
+ Addressee::List addressees = conv.parseVCards( data.utf8() );
if (addressees.isEmpty() == true) {
ret = false;
}
@@ -454,7 +454,7 @@ bool ResourceCardDav::parseData(const TQString& data) {
log("actually parsing the data");
TDEABC::VCardConverter conv;
- Addressee::List addressees = conv.parseVCards( data );
+ Addressee::List addressees = conv.parseVCards( data.utf8() );
Addressee::List::ConstIterator it;
for( it = addressees.begin(); it != addressees.end(); ++it ) {
TDEABC::Addressee addr = *it;
diff --git a/tderesources/carddav/writer.h b/tderesources/carddav/writer.h
index 9bd9429ab..3bfa76c3c 100644
--- a/tderesources/carddav/writer.h
+++ b/tderesources/carddav/writer.h
@@ -91,7 +91,7 @@ protected:
int pushObjects(const TQString& data, Operation op, int okCode, runtime_info* RT) {
int r = okCode;
if (!data.isNull() && !data.isEmpty()) {
- r = op(std::string(data.ascii()).c_str(), std::string(url().ascii()).c_str(), RT);
+ r = op(std::string(data.utf8()).c_str(), std::string(url().ascii()).c_str(), RT);
}
return r;
}