summaryrefslogtreecommitdiffstats
path: root/tderesources/caldav
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2014-01-18 14:13:43 +0100
committerSlávek Banko <[email protected]>2014-01-18 14:13:43 +0100
commit5a692370051844e966a42abcfc48beae75112539 (patch)
tree27d440e95022da3cc7f3a67c49a3eed5c344e4fc /tderesources/caldav
parentb415f1f1f41873febdad7448ad04648a148b1ad5 (diff)
downloadtdepim-5a692370051844e966a42abcfc48beae75112539.tar.gz
tdepim-5a692370051844e966a42abcfc48beae75112539.zip
Fix utf8 and html entities handling in CalDAV and CardDAV resources
Diffstat (limited to 'tderesources/caldav')
-rw-r--r--tderesources/caldav/reader.cpp7
-rw-r--r--tderesources/caldav/writer.h6
2 files changed, 7 insertions, 6 deletions
diff --git a/tderesources/caldav/reader.cpp b/tderesources/caldav/reader.cpp
index 92501e4f7..6d7400340 100644
--- a/tderesources/caldav/reader.cpp
+++ b/tderesources/caldav/reader.cpp
@@ -16,6 +16,7 @@
#include "reader.h"
#include <kdebug.h>
+#include <kcharsets.h>
#include <string>
/*=========================================================================
@@ -61,7 +62,7 @@ int CalDavReader::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
@@ -95,7 +96,7 @@ int CalDavReader::runTasksJob(runtime_info* RT) {
if (OK == tasksres) {
kdDebug() << "success" << '\n';
if (result->msg) {
- mTasksData = result->msg;
+ mTasksData = KCharsets::resolveEntities(TQString::fromUtf8(result->msg));
} else {
kdDebug() << "empty collection" << '\n';
// empty collection
@@ -129,7 +130,7 @@ int CalDavReader::runJournalsJob(runtime_info* RT) {
if (OK == journalsres) {
kdDebug() << "success" << '\n';
if (result->msg) {
- mJournalsData = result->msg;
+ mJournalsData = KCharsets::resolveEntities(TQString::fromUtf8(result->msg));
} else {
kdDebug() << "empty collection" << '\n';
// empty collection
diff --git a/tderesources/caldav/writer.h b/tderesources/caldav/writer.h
index 437eeed0e..893fc0e81 100644
--- a/tderesources/caldav/writer.h
+++ b/tderesources/caldav/writer.h
@@ -156,7 +156,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;
}
@@ -166,7 +166,7 @@ protected:
int pushTasksObjects(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(tasksUrl().ascii()).c_str(), RT);
+ r = op(std::string(data.utf8()).c_str(), std::string(tasksUrl().ascii()).c_str(), RT);
}
return r;
}
@@ -176,7 +176,7 @@ protected:
int pushJournalsObjects(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(journalsUrl().ascii()).c_str(), RT);
+// r = op(std::string(data.utf8()).c_str(), std::string(journalsUrl().ascii()).c_str(), RT);
// }
return r;
}