2 commits - calendaring/event.cpp conversion/commonconversion.cpp conversion/commonconversion.h conversion/kabcconversion.cpp conversion/kcalconversion.cpp conversion/kolabconversion.cpp freebusy/freebusy.cpp icalendar/icalendar.cpp kolabformat/kolabobject.cpp mime/mimeutils.cpp mime/mimeutils.h tests/kcalconversiontest.cpp tests/testfiles tests/upgradetest.cpp

Christian Mollekopf mollekopf at kolabsys.com
Wed Aug 15 14:32:01 CEST 2012


 calendaring/event.cpp                      |    5 
 conversion/commonconversion.cpp            |    8 -
 conversion/commonconversion.h              |   10 +
 conversion/kabcconversion.cpp              |  154 ++++++++++++++---------------
 conversion/kcalconversion.cpp              |   70 ++++++-------
 conversion/kolabconversion.cpp             |   30 ++---
 freebusy/freebusy.cpp                      |    9 -
 icalendar/icalendar.cpp                    |   16 +--
 kolabformat/kolabobject.cpp                |   74 ++++++++-----
 mime/mimeutils.cpp                         |   11 ++
 mime/mimeutils.h                           |    4 
 tests/kcalconversiontest.cpp               |    2 
 tests/testfiles/v2/contacts/iso8859-1.mime |   79 ++++++++++++++
 tests/testfiles/v2/event/iso8859-1.mime    |   48 +++++++++
 tests/upgradetest.cpp                      |    2 
 15 files changed, 343 insertions(+), 179 deletions(-)

New commits:
commit b123e0604c7d6f9caab245006cc9f18d34af6210
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Aug 15 14:04:46 2012 +0200

    Autodetect type based on mimetype as fallback for v2 messages lacking the Kolab-Type header.

diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index fc97715..a8b1404 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -188,6 +188,17 @@ QByteArray getMimeType(Kolab::ObjectType type)
     return QByteArray();
 }
 
+Kolab::ObjectType detectType(const KMime::Message::Ptr &msg)
+{
+    Q_FOREACH(const QByteArray &type, Mime::getContentMimeTypeList(msg)) {
+        Kolab::ObjectType t = getObjectType(type); //works for v2 types
+        if (t != InvalidObject) {
+            return t;
+        }
+    }
+    return InvalidObject;
+}
+
 void printMessageDebugInfo(const KMime::Message::Ptr &msg)
 {
     //TODO replace by Debug stream for Mimemessage
@@ -342,19 +353,18 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
     }
     Kolab::ObjectType objectType = InvalidObject;
     if (d->mOverrideObjectType == InvalidObject) {
-        KMime::Headers::Base *xKolabHeader = msg->getHeaderByType(X_KOLAB_TYPE_HEADER);
-        if (!xKolabHeader) {
-            CRITICAL("could not find the X-Kolab-Type Header");
-            printMessageDebugInfo(msg);
-            return InvalidObject;
+        if (KMime::Headers::Base *xKolabHeader = msg->getHeaderByType(X_KOLAB_TYPE_HEADER)) {
+            objectType = getObjectType(xKolabHeader->asUnicodeString().trimmed());
+        } else {
+            Warning() << "could not find the X-Kolab-Type Header, trying autodetection" ;
+            //This works only for v2 messages atm.
+            objectType = detectType(msg);
         }
-        const QString &kolabType = xKolabHeader->asUnicodeString().trimmed();
-        objectType = getObjectType(kolabType);
     } else {
         objectType = d->mOverrideObjectType;
     }
     if (objectType == InvalidObject) {
-        Warning() << "invalid object type";
+        Critical() << "unable to detect object type";
         printMessageDebugInfo(msg);
         return InvalidObject;
     }
diff --git a/mime/mimeutils.cpp b/mime/mimeutils.cpp
index f51e498..a8259d3 100644
--- a/mime/mimeutils.cpp
+++ b/mime/mimeutils.cpp
@@ -75,6 +75,17 @@ KMime::Content* findContentById(const KMime::Message::Ptr &data, const QByteArra
     return 0;
 }
 
+QList<QByteArray> getContentMimeTypeList(const KMime::Message::Ptr& data)
+{
+    QList<QByteArray> typeList;
+    Q_ASSERT(!data->contents().isEmpty());
+    Q_FOREACH(KMime::Content *c, data->contents()) {
+        typeList.append(c->contentType()->mimeType());
+    }
+    return typeList;
+}
+
+
 
 QByteArray getXmlDocument(const KMime::Message::Ptr &data, const QByteArray &mimetype)
 {
diff --git a/mime/mimeutils.h b/mime/mimeutils.h
index 428cbcf..9d42ac4 100644
--- a/mime/mimeutils.h
+++ b/mime/mimeutils.h
@@ -29,12 +29,10 @@ class QDomDocument;
 namespace Kolab {
     namespace Mime {
 
-//TODO Generic
 KMime::Content* findContentByName(const KMime::Message::Ptr &data, const QString &name, QByteArray &type);
-//TODO Generic
 KMime::Content* findContentByType(const KMime::Message::Ptr &data, const QByteArray &type);
+QList<QByteArray> getContentMimeTypeList(const KMime::Message::Ptr &data);
 
-//TODO Generic
 QByteArray getXmlDocument(const KMime::Message::Ptr &data, const QByteArray &mimetype);
 
 /**


commit 896aaff79bdb118a811bc5614a3dac867fadc813
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Aug 15 02:12:27 2012 +0200

    Use conversions which preserve Unicode characters by using utf-8 for all std::strings.

diff --git a/calendaring/event.cpp b/calendaring/event.cpp
index f9de600..7571cd4 100644
--- a/calendaring/event.cpp
+++ b/calendaring/event.cpp
@@ -20,6 +20,7 @@
 #include <icalendar/icalendar.h>
 #include <kolabformat/kolabobject.h>
 #include <conversion/kcalconversion.h>
+#include <conversion/commonconversion.h>
 
 #include <iostream>
 #include <kolabformat.h>
@@ -63,7 +64,7 @@ std::string Event::write() const
 bool Event::fromMime(const std::string &input)
 {
     KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
-    msg->setContent( QString::fromStdString(input).toLatin1() );
+    msg->setContent( KMime::CRLFtoLF(Kolab::Conversion::fromStdString(input).toUtf8()) );
     msg->parse();
     msg->content(KMime::ContentIndex());
     KolabObjectReader reader(msg);
@@ -78,7 +79,7 @@ bool Event::fromMime(const std::string &input)
 
 std::string Event::toMime() const
 {
-    return QString(KolabObjectWriter::writeEvent(Kolab::Conversion::toKCalCore(*this))->encodedContent()).toStdString();
+    return std::string(QString(KolabObjectWriter::writeEvent(Kolab::Conversion::toKCalCore(*this))->encodedContent()).toUtf8().constData());
 }
 
 
diff --git a/conversion/commonconversion.cpp b/conversion/commonconversion.cpp
index 41deb9a..d516520 100644
--- a/conversion/commonconversion.cpp
+++ b/conversion/commonconversion.cpp
@@ -87,7 +87,7 @@ cDateTime fromDate(const KDateTime &dt)
             date.setUTC(true);
         } else if (dt.timeType() == KDateTime::TimeZone) { //Timezone
             //TODO handle local timezone?
-            date.setTimezone(dt.timeZone().name().toStdString()); //FIXME use system independent name according to spec
+            date.setTimezone(toStdString(dt.timeZone().name())); //FIXME use system independent name according to spec
         } else if (dt.timeType() != KDateTime::ClockTime) {
             Error() << "invalid timespec, assuming floating time" << dt.timeType();
             return date;
@@ -101,7 +101,7 @@ QStringList toStringList(const std::vector<std::string> &l)
 {
     QStringList list;
     foreach(const std::string &s, l) {
-        list.append(QString::fromStdString(s));
+        list.append(Conversion::fromStdString(s));
     }
     return list;
 }
@@ -110,7 +110,7 @@ std::vector<std::string> fromStringList(const QStringList &l)
 {
     std::vector<std::string> list;
     foreach(const QString &s, l) {
-        list.push_back(s.toStdString());
+        list.push_back(toStdString(s));
     }
     return list;
 }
@@ -129,7 +129,7 @@ QUrl toMailto(const std::string &email, const std::string &name)
 
 std::string fromMailto(const QUrl &mailtoUri, std::string &name)
 {
-    const std::string &decoded = mailtoUri.toString().toStdString();
+    const std::string &decoded = toStdString(mailtoUri.toString());
     if (decoded.substr(0, 7).compare("mailto:")) {
         WARNING("no mailto address");
         std::cout << decoded << std::endl;
diff --git a/conversion/commonconversion.h b/conversion/commonconversion.h
index a4b7a71..fd4c191 100644
--- a/conversion/commonconversion.h
+++ b/conversion/commonconversion.h
@@ -38,6 +38,16 @@ namespace Kolab {
 
         QUrl toMailto(const std::string &email, const std::string &name = std::string());
         std::string fromMailto(const QUrl &mailtoUri, std::string &name);
+        
+        inline std::string toStdString(const QString &s)
+        {
+            return std::string(s.toUtf8().constData());
+        }
+
+        inline QString fromStdString(const std::string &s)
+        {
+            return QString::fromUtf8(s.c_str());
+        }
 
     };
 };
diff --git a/conversion/kabcconversion.cpp b/conversion/kabcconversion.cpp
index d08f264..2134d2d 100644
--- a/conversion/kabcconversion.cpp
+++ b/conversion/kabcconversion.cpp
@@ -23,6 +23,8 @@
 #include <qbuffer.h>
 #include "kolabformat/errorhandler.h"
 
+
+
 namespace Kolab {
     namespace Conversion {
         
@@ -363,7 +365,7 @@ KABC::Picture toPicture(const std::string &data, const std::string &mimetype) {
     if (logo.isEmpty()) {
         Error() << "failed to read picture";
     }
-    logo.setType(QString::fromStdString(mimetype));
+    logo.setType(fromStdString(mimetype));
     return logo;
 }
 
@@ -390,29 +392,29 @@ std::string getCustom(const std::string &id, T &object)
 KABC::Addressee toKABC(const Kolab::Contact &contact)
 {
   KABC::Addressee addressee;
-  addressee.setUid(QString::fromStdString(contact.uid()));
+  addressee.setUid(fromStdString(contact.uid()));
   addressee.setCategories(toStringList(contact.categories()));
-  //addressee.setName(QString::fromStdString(contact.name()));//This one is only for compatiblity (and results in a non-existing name property)
-  addressee.setFormattedName(QString::fromStdString(contact.name())); //This on corresponds to fn
+  //addressee.setName(fromStdString(contact.name()));//This one is only for compatiblity (and results in a non-existing name property)
+  addressee.setFormattedName(fromStdString(contact.name())); //This on corresponds to fn
   
   const Kolab::NameComponents &nc = contact.nameComponents();
   if (!nc.surnames().empty()) {
-      addressee.setFamilyName(QString::fromStdString(nc.surnames().front()));
+      addressee.setFamilyName(fromStdString(nc.surnames().front()));
   }
   if (!nc.given().empty()) {
-      addressee.setGivenName(QString::fromStdString(nc.given().front()));
+      addressee.setGivenName(fromStdString(nc.given().front()));
   }
   if (!nc.additional().empty()) {
-      addressee.setAdditionalName(QString::fromStdString(nc.additional().front()));
+      addressee.setAdditionalName(fromStdString(nc.additional().front()));
   }
   if (!nc.prefixes().empty()) {
-      addressee.setPrefix(QString::fromStdString(nc.prefixes().front()));
+      addressee.setPrefix(fromStdString(nc.prefixes().front()));
   }
   if (!nc.suffixes().empty()) {
-      addressee.setSuffix(QString::fromStdString(nc.suffixes().front()));
+      addressee.setSuffix(fromStdString(nc.suffixes().front()));
   }
   
-  addressee.setNote(QString::fromStdString(contact.note()));
+  addressee.setNote(fromStdString(contact.note()));
   
   addressee.setSecrecy(KABC::Secrecy::Public); //We don't have any privacy setting in xCard
   
@@ -422,9 +424,9 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
   if (!contact.emailAddresses().empty()) {
       addressee.setEmails(toStringList(contact.emailAddresses()));
       if ((contact.emailAddressPreferredIndex() >= 0) && (contact.emailAddressPreferredIndex() < contact.emailAddresses().size())) {
-          preferredEmail = QString::fromStdString(contact.emailAddresses().at(contact.emailAddressPreferredIndex()));
+          preferredEmail = fromStdString(contact.emailAddresses().at(contact.emailAddressPreferredIndex()));
       } else {
-          preferredEmail = QString::fromStdString(contact.emailAddresses().at(0));
+          preferredEmail = fromStdString(contact.emailAddresses().at(0));
       }
       addressee.insertEmail(preferredEmail, true);
   }
@@ -433,26 +435,26 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
       if (preferredEmail.isEmpty()) {
           Error() << "f/b url is set but no email address available, skipping";
       } else  {
-        KCalCore::FreeBusyUrlStore::self()->writeUrl( preferredEmail, QString::fromStdString(contact.freeBusyUrl()) );
+        KCalCore::FreeBusyUrlStore::self()->writeUrl( preferredEmail, fromStdString(contact.freeBusyUrl()) );
         KCalCore::FreeBusyUrlStore::self()->sync();
       }
   }
   
   if (!contact.nickNames().empty()) {
-      addressee.setNickName(QString::fromStdString(contact.nickNames().at(0))); //TODO support multiple
+      addressee.setNickName(fromStdString(contact.nickNames().at(0))); //TODO support multiple
   }
   
   if (contact.bDay().isValid()) {
       addressee.setBirthday(toDate(contact.bDay()).dateTime());
   }
   if (!contact.titles().empty()) {
-      addressee.setTitle(QString::fromStdString(contact.titles().at(0))); //TODO support multiple
+      addressee.setTitle(fromStdString(contact.titles().at(0))); //TODO support multiple
   }
   if (!contact.urls().empty()) {
-      addressee.setUrl(QString::fromStdString(contact.urls().at(0).url())); //TODO support multiple
+      addressee.setUrl(fromStdString(contact.urls().at(0).url())); //TODO support multiple
       foreach(const Kolab::Url &u, contact.urls()) {
           if (u.type() == Kolab::Url::Blog) {
-              addressee.insertCustom("KADDRESSBOOK", "BlogFeed", QString::fromStdString(u.url()));
+              addressee.insertCustom("KADDRESSBOOK", "BlogFeed", fromStdString(u.url()));
           }
       }
   }
@@ -462,13 +464,13 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
       //Storing only a const reference leads to segfaults. No idea why.
       const Kolab::Affiliation aff = contact.affiliations().at(0); //TODO support multiple
       if (!aff.organisation().empty()) {
-          addressee.setOrganization(QString::fromStdString(aff.organisation()));
+          addressee.setOrganization(fromStdString(aff.organisation()));
       }
       if (!aff.organisationalUnits().empty()) {
-          addressee.setDepartment(QString::fromStdString(aff.organisationalUnits().at(0))); //TODO support multiple
+          addressee.setDepartment(fromStdString(aff.organisationalUnits().at(0))); //TODO support multiple
       }
       if (!aff.roles().empty()) {
-          addressee.setRole(QString::fromStdString(aff.roles().at(0))); //TODO support multiple
+          addressee.setRole(fromStdString(aff.roles().at(0))); //TODO support multiple
       }
       if (!aff.logo().empty()) {
           addressee.setLogo(toPicture(aff.logo(), aff.logoMimetype()));
@@ -479,24 +481,24 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
               continue;
           }
           if (related.relationTypes() & Kolab::Related::Assistant) {
-              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-AssistantsName"), QString::fromStdString(related.text()));
+              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-AssistantsName"), fromStdString(related.text()));
           }
           if (related.relationTypes() & Kolab::Related::Manager) {
-              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-ManagersName"), QString::fromStdString(related.text()));
+              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-ManagersName"), fromStdString(related.text()));
           }
       }
       foreach(const Kolab::Address &address, aff.addresses()) {
-          addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Office"), QString::fromStdString(address.label())); //TODO support proper addresses
+          addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Office"), fromStdString(address.label())); //TODO support proper addresses
       }
   }
   const std::string &prof = getCustom("X-Profession", contact);
   if (!prof.empty()) {
-    addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Profession"), QString::fromStdString(prof));
+    addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Profession"), fromStdString(prof));
   }
   
   const std::string &adrBook = getCustom("X-AddressBook", contact);
   if (!adrBook.empty()) {
-      addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-AddressBook"), QString::fromStdString(prof));
+      addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-AddressBook"), fromStdString(prof));
   }
   
   if (!contact.photo().empty()) {
@@ -510,7 +512,7 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
           if (index == contact.telephonesPreferredIndex()) {
               pref = true;
           }
-          KABC::PhoneNumber number(QString::fromStdString(tel.number()), toPhoneType(tel.types(), pref));
+          KABC::PhoneNumber number(fromStdString(tel.number()), toPhoneType(tel.types(), pref));
           index++;
           addressee.insertPhoneNumber(number);
       }
@@ -524,12 +526,12 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
               pref = true;
           }
           KABC::Address adr(toAddressType(a.types(), pref));          
-          adr.setLabel(QString::fromStdString(a.label()));
-          adr.setStreet(QString::fromStdString(a.street()));
-          adr.setLocality(QString::fromStdString(a.locality()));
-          adr.setRegion(QString::fromStdString(a.region()));
-          adr.setPostalCode(QString::fromStdString(a.code()));
-          adr.setCountry(QString::fromStdString(a.country()));
+          adr.setLabel(fromStdString(a.label()));
+          adr.setStreet(fromStdString(a.street()));
+          adr.setLocality(fromStdString(a.locality()));
+          adr.setRegion(fromStdString(a.region()));
+          adr.setPostalCode(fromStdString(a.code()));
+          adr.setCountry(fromStdString(a.country()));
           
           index++;
           addressee.insertAddress(adr);
@@ -541,7 +543,7 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
   }
   
   if (!contact.imAddresses().empty()) {
-      addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-IMAddress"),QString::fromStdString(contact.imAddresses()[0])); //TODO support multiple
+      addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-IMAddress"),fromStdString(contact.imAddresses()[0])); //TODO support multiple
   }
   
   if (!contact.relateds().empty()) {
@@ -551,7 +553,7 @@ KABC::Addressee toKABC(const Kolab::Contact &contact)
               continue;
           }
           if (rel.relationTypes() & Kolab::Related::Spouse) {
-              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-SpousesName"),QString::fromStdString(rel.text())); //TODO support multiple
+              addressee.insertCustom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-SpousesName"),fromStdString(rel.text())); //TODO support multiple
           } else {
               Warning() << "relation not supported";
               continue;
@@ -567,32 +569,32 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
     int prefNum = -1;
     int prefCounter = -1;
     Kolab::Contact c;
-    c.setUid(addressee.uid().toStdString());
+    c.setUid(toStdString(addressee.uid()));
     c.setCategories(fromStringList(addressee.categories()));
-    c.setName(addressee.formattedName().toStdString());
-    
+    c.setName(toStdString(addressee.formattedName()));
     Kolab::NameComponents nc;
-    nc.setSurnames(std::vector<std::string>() << addressee.familyName().toStdString());
-    nc.setGiven(std::vector<std::string>() << addressee.givenName().toStdString());
-    nc.setAdditional(std::vector<std::string>() << addressee.additionalName().toStdString());
-    nc.setPrefixes(std::vector<std::string>() << addressee.prefix().toStdString());
-    nc.setSuffixes(std::vector<std::string>() << addressee.suffix().toStdString());
+    nc.setSurnames(std::vector<std::string>() << toStdString(addressee.familyName()));
+    nc.setGiven(std::vector<std::string>() << toStdString(addressee.givenName()));
+    nc.setAdditional(std::vector<std::string>() << toStdString(addressee.additionalName()));
+    nc.setPrefixes(std::vector<std::string>() << toStdString(addressee.prefix()));
+    nc.setSuffixes(std::vector<std::string>() << toStdString(addressee.suffix()));
     c.setNameComponents(nc);
     
-    c.setNote(addressee.note().toStdString());
+    c.setNote(toStdString(addressee.note()));
     
     if ( !addressee.preferredEmail().isEmpty() ) {    
-        c.setFreeBusyUrl(KCalCore::FreeBusyUrlStore::self()->readUrl( addressee.preferredEmail() ).toStdString());
+        c.setFreeBusyUrl(toStdString(KCalCore::FreeBusyUrlStore::self()->readUrl( addressee.preferredEmail() )));
     }
 
     if (!addressee.title().isEmpty()) {
-        c.setTitles(std::vector<std::string>() << addressee.title().toStdString());
+        c.setTitles(std::vector<std::string>() << toStdString(addressee.title()));
     }
     
     Kolab::Affiliation businessAff;
-    businessAff.setOrganisation(addressee.organization().toStdString());
+    businessAff.setOrganisation(toStdString(addressee.organization()));
     if (!addressee.department().isEmpty()) {
-        businessAff.setOrganisationalUnits(std::vector<std::string>() << addressee.department().toStdString());
+        Debug() << addressee.department() << addressee.department().toLatin1() << addressee.department().toUtf8();
+        businessAff.setOrganisationalUnits(std::vector<std::string>() << toStdString(addressee.department()));
     }
 
     if (!addressee.logo().isEmpty()) {
@@ -601,24 +603,24 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
         businessAff.setLogo(logo, logoMimetype);
     }
     if (!addressee.role().isEmpty()) {
-        businessAff.setRoles(std::vector<std::string>() << addressee.role().toStdString());
+        businessAff.setRoles(std::vector<std::string>() << toStdString(addressee.role()));
     }
     const QString &office = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Office"));
     if (!office.isEmpty()) {
         Kolab::Address a;
         a.setTypes(Kolab::Address::Work);
-        a.setLabel(addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Office")).toStdString());
+        a.setLabel(toStdString(addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Office"))));
         businessAff.setAddresses(std::vector<Kolab::Address>() << a);
     }
     
     std::vector<Kolab::Related> relateds;
     const QString &manager = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-ManagersName"));
     if (!manager.isEmpty()) {
-        relateds.push_back(Kolab::Related(Kolab::Related::Text, manager.toStdString(), Kolab::Related::Manager));
+        relateds.push_back(Kolab::Related(Kolab::Related::Text, toStdString(manager), Kolab::Related::Manager));
     }
     const QString &assistant = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-AssistantsName"));
     if (!assistant.isEmpty()) {
-        relateds.push_back(Kolab::Related(Kolab::Related::Text, assistant.toStdString(), Kolab::Related::Assistant));
+        relateds.push_back(Kolab::Related(Kolab::Related::Text, toStdString(assistant), Kolab::Related::Assistant));
     }
     if (!relateds.empty()) {
         businessAff.setRelateds(relateds);
@@ -627,11 +629,11 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
     
     std::vector<Kolab::Url> urls;
     if (!addressee.url().isEmpty()) {
-        urls.push_back(Kolab::Url(addressee.url().url().toStdString()));
+        urls.push_back(Kolab::Url(toStdString(addressee.url().url())));
     }   
     const QString &blogUrl = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("BlogFeed"));
     if (!blogUrl.isEmpty()) {
-        urls.push_back(Kolab::Url(blogUrl.toStdString(), Kolab::Url::Blog));
+        urls.push_back(Kolab::Url(toStdString(blogUrl), Kolab::Url::Blog));
     }
     c.setUrls(urls);
     
@@ -646,23 +648,23 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
         if (pref) {
             prefNum = prefCounter;
         }
-        adr.setLabel(a.label().toStdString());
-        adr.setStreet(a.street().toStdString());
-        adr.setLocality(a.locality().toStdString());
-        adr.setRegion(a.region().toStdString());
-        adr.setCode(a.postalCode().toStdString());
-        adr.setCountry(a.country().toStdString());
+        adr.setLabel(toStdString(a.label()));
+        adr.setStreet(toStdString(a.street()));
+        adr.setLocality(toStdString(a.locality()));
+        adr.setRegion(toStdString(a.region()));
+        adr.setCode(toStdString(a.postalCode()));
+        adr.setCountry(toStdString(a.country()));
         addresses.push_back(adr);
     }
     c.setAddresses(addresses, prefNum);
     
     if (!addressee.nickName().isEmpty()) {
-        c.setNickNames(std::vector<std::string>() << addressee.nickName().toStdString());
+        c.setNickNames(std::vector<std::string>() << toStdString(addressee.nickName()));
     }
     
     const QString &spouse = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-SpousesName"));
     if (!spouse.isEmpty()) {
-        c.setRelateds(std::vector<Kolab::Related>() << Kolab::Related(Kolab::Related::Text, spouse.toStdString(), Kolab::Related::Spouse));
+        c.setRelateds(std::vector<Kolab::Related>() << Kolab::Related(Kolab::Related::Text, toStdString(spouse), Kolab::Related::Spouse));
     }
     c.setBDay(fromDate(KDateTime(addressee.birthday(), KDateTime::ClockTime)));
     c.setAnniversary(fromDate(KDateTime(QDate::fromString( addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-Anniversary")), Qt::ISODate ), KDateTime::ClockTime)));
@@ -680,7 +682,7 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
     prefCounter = -1;
     foreach (const KABC::PhoneNumber &n, addressee.phoneNumbers()) {
         Kolab::Telephone p;
-        p.setNumber(n.number().toStdString());
+        p.setNumber(toStdString(n.number()));
         bool pref = false;
         p.setTypes(fromPhoneType(n.type(), pref));
         prefCounter++;
@@ -693,7 +695,7 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
     
     const QString &imAddress = addressee.custom(QLatin1String("KADDRESSBOOK"), QLatin1String("X-IMAddress"));
     if (!imAddress.isEmpty()) {
-        c.setIMaddresses(std::vector<std::string>() << imAddress.toStdString(), 0);
+        c.setIMaddresses(std::vector<std::string>() << toStdString(imAddress), 0);
     }
     
     int prefEmail = -1;
@@ -772,11 +774,11 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
     
     //FIXME the keys are most certainly worng, look at cryptopageplugin.cpp
     std::vector<Kolab::Key> keys;
-    const std::string &pgpkey = addressee.custom( "KADDRESSBOOK", "OPENPGPFP" ).toStdString();
+    const std::string &pgpkey = toStdString(addressee.custom( "KADDRESSBOOK", "OPENPGPFP" ));
     if (!pgpkey.empty()) {
         keys.push_back(Kolab::Key(pgpkey, Kolab::Key::PGP));
     }
-    const std::string &smimekey = addressee.custom( "KADDRESSBOOK", "SMIMEFP" ).toStdString();
+    const std::string &smimekey = toStdString(addressee.custom( "KADDRESSBOOK", "SMIMEFP" ));
     if (!smimekey.empty()) {
         keys.push_back(Kolab::Key(smimekey, Kolab::Key::PKCS7_MIME));
     }
@@ -787,12 +789,12 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
         Warning() << "sound is not supported";
     }
     
-    const std::string &profession = addressee.custom( "KADDRESSBOOK", "X-Profession" ).toStdString();
+    const std::string &profession = toStdString(addressee.custom( "KADDRESSBOOK", "X-Profession" ));
     if (!profession.empty()) {
         setCustom(profession, "X-Profession", c);
     }
     
-    const std::string &adrBook = addressee.custom( "KADDRESSBOOK", "X-AddressBook" ).toStdString();
+    const std::string &adrBook = toStdString(addressee.custom( "KADDRESSBOOK", "X-AddressBook" ));
     if (!adrBook.empty()) {
         setCustom(adrBook, "X-AddressBook", c);
     }
@@ -805,17 +807,17 @@ Kolab::Contact fromKABC(const KABC::Addressee &addressee)
 DistList fromKABC(const KABC::ContactGroup &cg)
 {
     DistList dl;
-    dl.setName(cg.name().toStdString());
-    dl.setUid(cg.id().toStdString());
+    dl.setName(toStdString(cg.name()));
+    dl.setUid(toStdString(cg.id()));
     
     std::vector <Kolab::ContactReference > members;
     for (int i = 0; i < cg.dataCount(); i++) {
         const KABC::ContactGroup::Data &data = cg.data(i);
-        members.push_back(Kolab::ContactReference(Kolab::ContactReference::EmailReference, data.email().toStdString(), data.name().toStdString()));
+        members.push_back(Kolab::ContactReference(Kolab::ContactReference::EmailReference, toStdString(data.email()), toStdString(data.name())));
     }
     for (int i = 0; i < cg.contactReferenceCount(); i++) {
         const KABC::ContactGroup::ContactReference &ref = cg.contactReference(i);
-        members.push_back(Kolab::ContactReference(Kolab::ContactReference::UidReference, ref.uid().toStdString()));
+        members.push_back(Kolab::ContactReference(Kolab::ContactReference::UidReference, toStdString(ref.uid())));
     }
     
     if (cg.contactGroupReferenceCount() > 0) {
@@ -829,16 +831,16 @@ DistList fromKABC(const KABC::ContactGroup &cg)
 
 KABC::ContactGroup toKABC(const DistList &dl)
 {
-    KABC::ContactGroup cg(QString::fromStdString(dl.name()));
-    cg.setId(QString::fromStdString(dl.uid()));
+    KABC::ContactGroup cg(fromStdString(dl.name()));
+    cg.setId(fromStdString(dl.uid()));
     foreach(const Kolab::ContactReference &m, dl.members()) {
         KABC::ContactGroup::Data data;
         switch (m.type()) {
             case Kolab::ContactReference::EmailReference:
-                cg.append(KABC::ContactGroup::Data(QString::fromStdString(m.name()), QString::fromStdString(m.email())));
+                cg.append(KABC::ContactGroup::Data(fromStdString(m.name()), fromStdString(m.email())));
                 break;
             case Kolab::ContactReference::UidReference:
-                cg.append(KABC::ContactGroup::ContactReference(QString::fromStdString(m.uid())));
+                cg.append(KABC::ContactGroup::ContactReference(fromStdString(m.uid())));
                 break;
             default:
                 Error() << "invalid contact reference";
@@ -850,4 +852,4 @@ KABC::ContactGroup toKABC(const DistList &dl)
 
 
     } //Namespace
-} //Namespace
\ No newline at end of file
+} //Namespace
diff --git a/conversion/kcalconversion.cpp b/conversion/kcalconversion.cpp
index 4ab8cf5..f9a0943 100644
--- a/conversion/kcalconversion.cpp
+++ b/conversion/kcalconversion.cpp
@@ -254,8 +254,8 @@ QString getCustomProperty(const QString &id, const T &e)
 {
     std::vector<CustomProperty> &props = e.customProperties();
     foreach (const CustomProperty &p, props) {
-        if (QString::fromStdString(p.identifier) == id) {
-            return QString::fromStdString(p.value);
+        if (fromStdString(p.identifier) == id) {
+            return fromStdString(p.value);
         }
     }
 }
@@ -264,7 +264,7 @@ template <typename T>
 void setIncidence(KCalCore::Incidence &i, const T &e)
 {
     if (!e.uid().empty()) {
-        i.setUid(QString::fromStdString(e.uid()));
+        i.setUid(fromStdString(e.uid()));
     }
     
     i.setCreated(toDate(e.created()));
@@ -277,21 +277,21 @@ void setIncidence(KCalCore::Incidence &i, const T &e)
         i.setDtStart(toDate(e.start()));
     }
 
-    i.setSummary(QString::fromStdString(e.summary())); //TODO detect richtext
-    i.setDescription(QString::fromStdString(e.description())); //TODO detect richtext
+    i.setSummary(fromStdString(e.summary())); //TODO detect richtext
+    i.setDescription(fromStdString(e.description())); //TODO detect richtext
     i.setStatus(toStatus(e.status()));
     foreach (const Kolab::Attendee a, e.attendees()) {
         /*
          * KCalCore always sets a UID if empty, but that's just a pointer, and not the uid of a real contact.
          * Since that means the semantics of the two are different, we have to store the kolab uid as a custom property.
          */
-        KCalCore::Attendee::Ptr attendee = KCalCore::Attendee::Ptr(new KCalCore::Attendee(QString::fromStdString(a.contact().name()), 
-                                                                                          QString::fromStdString(a.contact().email()),
+        KCalCore::Attendee::Ptr attendee = KCalCore::Attendee::Ptr(new KCalCore::Attendee(fromStdString(a.contact().name()), 
+                                                                                          fromStdString(a.contact().email()),
                                                                                           a.rsvp(),
                                                                                           toPartStat(a.partStat()),
                                                                                           toRole(a.role()) ));
         if (!a.contact().uid().empty()) { //TODO Identify contact from addressbook based on uid
-            attendee->customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID, QString::fromStdString(a.contact().uid()));
+            attendee->customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID, fromStdString(a.contact().uid()));
         }
         if (!a.delegatedTo().empty()) {
             if (a.delegatedTo().size() > 1) {
@@ -313,12 +313,12 @@ void setIncidence(KCalCore::Incidence &i, const T &e)
     foreach (const Kolab::Attachment a, e.attachments()) {
         KCalCore::Attachment::Ptr ptr;
         if (!a.uri().empty()) {
-            ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(QString::fromStdString(a.uri()), QString::fromStdString(a.mimetype())));
+            ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(fromStdString(a.uri()), fromStdString(a.mimetype())));
         } else {
-            ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(QByteArray::fromRawData(a.data().c_str(), a.data().size()), QString::fromStdString(a.mimetype())));
+            ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(QByteArray::fromRawData(a.data().c_str(), a.data().size()), fromStdString(a.mimetype())));
         }
         if (!a.label().empty()) {
-            ptr->setLabel(QString::fromStdString(a.label()));
+            ptr->setLabel(fromStdString(a.label()));
         }
         i.addAttachment(ptr);
     }
@@ -329,9 +329,9 @@ void setIncidence(KCalCore::Incidence &i, const T &e)
         if (prop.identifier.compare(0, 5, "X-KDE")) {
             key.append(QString::fromLatin1("X-KOLAB-"));
         }
-        key.append(QString::fromStdString(prop.identifier));
-        props.insert(key.toLatin1(), QString::fromStdString(prop.value));
-//         i.setCustomProperty("KOLAB", QString::fromStdString(prop.identifier).toLatin1(), QString::fromStdString(prop.value));
+        key.append(fromStdString(prop.identifier));
+        props.insert(key.toLatin1(), fromStdString(prop.value));
+//         i.setCustomProperty("KOLAB", fromStdString(prop.identifier).toLatin1(), fromStdString(prop.value));
     }
     i.setCustomProperties(props);
 }
@@ -339,7 +339,7 @@ void setIncidence(KCalCore::Incidence &i, const T &e)
 template <typename T, typename I>
 void getIncidence(T &i, const I &e)
 {
-    i.setUid(e.uid().toStdString());
+    i.setUid(toStdString(e.uid()));
     i.setCreated(fromDate(e.created()));
     i.setLastModified(fromDate(e.lastModified()));
     i.setSequence(e.revision());
@@ -347,13 +347,13 @@ void getIncidence(T &i, const I &e)
     i.setCategories(fromStringList(e.categories()));
     
     i.setStart(fromDate(e.dtStart()));
-    i.setSummary(e.summary().toStdString());
-    i.setDescription(e.description().toStdString());
+    i.setSummary(toStdString(e.summary()));
+    i.setDescription(toStdString(e.description()));
     i.setStatus(fromStatus(e.status()));
     std::vector<Kolab::Attendee> attendees;
     foreach (const KCalCore::Attendee::Ptr ptr, e.attendees()) {
         const QString &uid = ptr->customProperties().nonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID);
-        Kolab::Attendee a(Kolab::ContactReference(ptr->email().toStdString(), ptr->name().toStdString(), uid.toStdString()));
+        Kolab::Attendee a(Kolab::ContactReference(toStdString(ptr->email()), toStdString(ptr->name()), toStdString(uid)));
         a.setRSVP(ptr->RSVP());
         a.setPartStat(fromPartStat(ptr->status()));
         a.setRole(fromRole(ptr->role()));
@@ -379,11 +379,11 @@ void getIncidence(T &i, const I &e)
     foreach (const KCalCore::Attachment::Ptr &ptr, e.attachments()) {
         Kolab::Attachment a;
         if (ptr->isUri()) {
-            a.setUri(ptr->uri().toStdString(), ptr->mimeType().toStdString());
+            a.setUri(toStdString(ptr->uri()), toStdString(ptr->mimeType()));
         } else {
-            a.setData(std::string(ptr->decodedData().data(), ptr->decodedData().size()), ptr->mimeType().toStdString());
+            a.setData(std::string(ptr->decodedData().data(), ptr->decodedData().size()), toStdString(ptr->mimeType()));
         }
-        a.setLabel(ptr->label().toStdString());
+        a.setLabel(toStdString(ptr->label()));
         attachments.push_back(a);
     }
     i.setAttachments(attachments);
@@ -392,7 +392,7 @@ void getIncidence(T &i, const I &e)
     const QMap<QByteArray, QString> &props = e.customProperties();
     for (QMap<QByteArray, QString>::const_iterator it = props.begin(); it != props.end(); it++) {
         QString key = QString(it.key());
-        customProperties.push_back(Kolab::CustomProperty(key.remove("X-KOLAB-").toStdString(), it.value().toStdString()));
+        customProperties.push_back(Kolab::CustomProperty(toStdString(key.remove("X-KOLAB-")), toStdString(it.value())));
     }
     i.setCustomProperties(customProperties);
 }
@@ -648,10 +648,10 @@ void setTodoEvent(KCalCore::Incidence &i, const T &e)
 {
     i.setPriority(toPriority(e.priority()));
     if (!e.location().empty()) {
-        i.setLocation(QString::fromStdString(e.location())); //TODO detect richtext
+        i.setLocation(fromStdString(e.location())); //TODO detect richtext
     }
     if (e.organizer().isValid()) {
-        i.setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person(QString::fromStdString(e.organizer().name()), QString::fromStdString(e.organizer().email())))); //TODO handle uid too
+        i.setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person(fromStdString(e.organizer().name()), fromStdString(e.organizer().email())))); //TODO handle uid too
     }
     if (e.recurrenceID().isValid()) {
         i.setRecurrenceId(toDate(e.recurrenceID())); //TODO THISANDFUTURE
@@ -663,17 +663,17 @@ void setTodoEvent(KCalCore::Incidence &i, const T &e)
             case Kolab::Alarm::EMailAlarm: {
                 KCalCore::Person::List receipents;
                 foreach (Kolab::ContactReference c ,a.attendees()) {
-                    KCalCore::Person::Ptr person = KCalCore::Person::Ptr(new KCalCore::Person(QString::fromStdString(c.name()), QString::fromStdString(c.email())));
+                    KCalCore::Person::Ptr person = KCalCore::Person::Ptr(new KCalCore::Person(fromStdString(c.name()), fromStdString(c.email())));
                     receipents.append(person);
                 }
-                alarm->setEmailAlarm(QString::fromStdString(a.summary()), QString::fromStdString(a.description()), receipents);
+                alarm->setEmailAlarm(fromStdString(a.summary()), fromStdString(a.description()), receipents);
             }
                 break;
             case Kolab::Alarm::DisplayAlarm:
-                alarm->setDisplayAlarm(QString::fromStdString(a.text()));
+                alarm->setDisplayAlarm(fromStdString(a.text()));
                 break;
             case Kolab::Alarm::AudioAlarm:
-                alarm->setAudioAlarm(QString::fromStdString(a.audioFile().uri()));
+                alarm->setAudioAlarm(fromStdString(a.audioFile().uri()));
                 break;
             default:
                 Error() << "invalid alarm";
@@ -700,9 +700,9 @@ template <typename T, typename I>
 void getTodoEvent(T &i, const I &e)
 {
     i.setPriority(fromPriority(e.priority()));
-    i.setLocation(e.location().toStdString());
+    i.setLocation(toStdString(e.location()));
     if (e.organizer() && !e.organizer()->email().isEmpty()) {
-        i.setOrganizer(Kolab::ContactReference(Kolab::ContactReference::EmailReference, e.organizer()->email().toStdString(), e.organizer()->name().toStdString())); //TODO handle uid too
+        i.setOrganizer(Kolab::ContactReference(Kolab::ContactReference::EmailReference, toStdString(e.organizer()->email()), toStdString(e.organizer()->name()))); //TODO handle uid too
     }
     i.setRecurrenceID(fromDate(e.recurrenceId()), false); //TODO THISANDFUTURE
     getRecurrence(i, e);
@@ -717,19 +717,19 @@ void getTodoEvent(T &i, const I &e)
         }
         switch (a->type()) {
             case KCalCore::Alarm::Display:
-                alarm = Kolab::Alarm(a->text().toStdString());
+                alarm = Kolab::Alarm(toStdString(a->text()));
                 break;
             case KCalCore::Alarm::Email: {
                 std::vector<Kolab::ContactReference> receipents;
                 foreach(const KCalCore::Person::Ptr &p, a->mailAddresses()) {
-                    receipents.push_back(Kolab::ContactReference(p->email().toStdString(), p->name().toStdString()));
+                    receipents.push_back(Kolab::ContactReference(toStdString(p->email()), toStdString(p->name())));
                 }
-                alarm = Kolab::Alarm(a->mailSubject().toStdString(), a->mailText().toStdString(), receipents);
+                alarm = Kolab::Alarm(toStdString(a->mailSubject()), toStdString(a->mailText()), receipents);
             }
                 break;
             case KCalCore::Alarm::Audio: {
                 Kolab::Attachment audioFile;
-                audioFile.setUri(a->audioFile().toStdString(), std::string());
+                audioFile.setUri(toStdString(a->audioFile()), std::string());
                 alarm = Kolab::Alarm(audioFile);
             }
                 break;
@@ -835,4 +835,4 @@ Journal fromKCalCore ( const KCalCore::Journal &journal )
 
 
 }
-}
\ No newline at end of file
+}
diff --git a/conversion/kolabconversion.cpp b/conversion/kolabconversion.cpp
index 4952b02..9c1fcfb 100644
--- a/conversion/kolabconversion.cpp
+++ b/conversion/kolabconversion.cpp
@@ -27,15 +27,15 @@ Note fromNote(const KMime::Message::Ptr &m)
 {
     Akonadi::NoteUtils::NoteMessageWrapper note(m);
     Note n;
-    n.setSummary(note.title().toStdString());
-    n.setDescription(note.text().toStdString());
+    n.setSummary(toStdString(note.title()));
+    n.setDescription(toStdString(note.text()));
     KDateTime created = note.creationDate();
     created.setTimeSpec(KDateTime::UTC);
     n.setCreated(fromDate(created));
 
 // #if KDEPIMLIBS_VERSION >= 0x040840
 #ifdef KDEPIMLIBS_VERSION_DEVEL
-    n.setUid(note.uid().toStdString());
+    n.setUid(toStdString(note.uid()));
     KDateTime lastModified = note.lastModifiedDate();
     lastModified.setTimeSpec(KDateTime::UTC);
     n.setLastModified(fromDate(lastModified));
@@ -53,7 +53,7 @@ Note fromNote(const KMime::Message::Ptr &m)
     
     std::vector<Kolab::CustomProperty> customs;
     for (QMap <QString, QString >::const_iterator it = note.custom().begin(); it != note.custom().end(); it ++) {
-        customs.push_back(Kolab::CustomProperty(it.key().toStdString(), it.value().toStdString()));
+        customs.push_back(Kolab::CustomProperty(toStdString(it.key()), toStdString(it.value())));
     }
     n.setCustomProperties(customs);
     
@@ -61,11 +61,11 @@ Note fromNote(const KMime::Message::Ptr &m)
     foreach(const Akonadi::NoteUtils::Attachment &a, note.attachments()) {
         Kolab::Attachment attachment;
         if (a.url().isValid()) {
-            attachment.setUri(a.url().toString().toStdString(), a.mimetype().toStdString());
+            attachment.setUri(toStdString(a.url().toString()), toStdString(a.mimetype()));
         } else {
-            attachment.setData(QString(a.data()).toStdString(), a.mimetype().toStdString());
+            attachment.setData(toStdString(QString(a.data())), toStdString(a.mimetype()));
         }
-        attachment.setLabel(a.label().toStdString());
+        attachment.setLabel(toStdString(a.label()));
         attachments.push_back(attachment);
     }
     n.setAttachments(attachments);
@@ -77,12 +77,12 @@ Note fromNote(const KMime::Message::Ptr &m)
 KMime::Message::Ptr toNote(const Note &n)
 {
     Akonadi::NoteUtils::NoteMessageWrapper note;
-    note.setTitle(QString::fromStdString(n.summary()));
-    note.setText(QString::fromStdString(n.description()));
+    note.setTitle(fromStdString(n.summary()));
+    note.setText(fromStdString(n.description()));
     note.setFrom("kolab at kde4");
     note.setCreationDate(toDate(n.created()));
 #ifdef KDEPIMLIBS_VERSION_DEVEL
-    note.setUid(QString::fromStdString(n.uid()));
+    note.setUid(fromStdString(n.uid()));
     note.setLastModifiedDate(toDate(n.lastModified()));
     switch (n.classification()) {
         case Kolab::ClassPrivate:
@@ -97,17 +97,17 @@ KMime::Message::Ptr toNote(const Note &n)
 
     foreach (const Kolab::Attachment &a, n.attachments()) {
         if (!a.uri().empty()) {
-            Akonadi::NoteUtils::Attachment attachment(QUrl(QString::fromStdString(a.uri())), QString::fromStdString(a.mimetype()));
-            attachment.setLabel(QString::fromStdString(a.label()));
+            Akonadi::NoteUtils::Attachment attachment(QUrl(fromStdString(a.uri())), fromStdString(a.mimetype()));
+            attachment.setLabel(fromStdString(a.label()));
             note.attachments().append(attachment);
         } else {
-            Akonadi::NoteUtils::Attachment attachment(QString::fromStdString(a.data()).toLatin1(), QString::fromStdString(a.mimetype()));
-            attachment.setLabel(QString::fromStdString(a.label()));
+            Akonadi::NoteUtils::Attachment attachment(fromStdString(a.data()).toLatin1(), fromStdString(a.mimetype()));
+            attachment.setLabel(fromStdString(a.label()));
             note.attachments().append(attachment);
         }
     }
     foreach (const Kolab::CustomProperty &a, n.customProperties()) {
-        note.custom().insert(QString::fromStdString(a.identifier), QString::fromStdString(a.value));
+        note.custom().insert(fromStdString(a.identifier), fromStdString(a.value));
     }
 #endif
     return note.message();
diff --git a/freebusy/freebusy.cpp b/freebusy/freebusy.cpp
index cd090bd..ae7bb98 100644
--- a/freebusy/freebusy.cpp
+++ b/freebusy/freebusy.cpp
@@ -18,6 +18,7 @@
 
 #include "freebusy.h"
 #include "conversion/kcalconversion.h"
+#include "conversion/commonconversion.h"
 #include <kcalcore/freebusy.h>
 #include <kcalcore/icalformat.h>
 #include <kdebug.h>
@@ -227,7 +228,7 @@ Freebusy generateFreeBusy(const QList<KCalCore::Event::Ptr>& events, const KDate
             period.setPeriods(periods);
             //TODO get busy type from event (out-of-office, tentative)
             period.setType(Kolab::FreebusyPeriod::Busy);
-            period.setEvent(event->uid().toStdString(), event->summary().toStdString(), event->location().toStdString());
+            period.setEvent(Kolab::Conversion::toStdString(event->uid()), Kolab::Conversion::toStdString(event->summary()), Kolab::Conversion::toStdString(event->location()));
             freebusyPeriods.push_back(period);
         }
     }
@@ -240,7 +241,7 @@ Freebusy generateFreeBusy(const QList<KCalCore::Event::Ptr>& events, const KDate
     freebusy.setUid(QUuid::createUuid().toString().toStdString());
     freebusy.setTimestamp(Kolab::Conversion::fromDate(KDateTime::currentUtcDateTime()));
     if (organizer) {
-        freebusy.setOrganizer(ContactReference(Kolab::ContactReference::EmailReference, organizer->email().toStdString(), organizer->name().toStdString()));
+        freebusy.setOrganizer(ContactReference(Kolab::ContactReference::EmailReference, Kolab::Conversion::toStdString(organizer->email()), Kolab::Conversion::toStdString(organizer->name())));
     }
     
     return freebusy;
@@ -301,12 +302,12 @@ std::string toIFB(const Kolab::Freebusy &freebusy)
     fb->addPeriods(list);
 
     fb->setUid(QString::fromStdString(freebusy.uid()));
-    fb->setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person(QString::fromStdString(freebusy.organizer().name()), QString::fromStdString(freebusy.organizer().email()))));
+    fb->setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person(Conversion::fromStdString(freebusy.organizer().name()), Conversion::fromStdString(freebusy.organizer().email()))));
     fb->setLastModified(Kolab::Conversion::toDate(freebusy.timestamp()));
 
     KCalCore::ICalFormat format;
     QString data = format.createScheduleMessage( fb, KCalCore::iTIPPublish );
-    return data.toStdString();
+    return Conversion::toStdString(data);
 }
 
     }
diff --git a/icalendar/icalendar.cpp b/icalendar/icalendar.cpp
index 474b8e9..03c360b 100644
--- a/icalendar/icalendar.cpp
+++ b/icalendar/icalendar.cpp
@@ -44,7 +44,7 @@ std::string toICal(const std::vector<Event> &events)
     KCalCore::ICalFormat format;
 //     qDebug() << format.createScheduleMessage(calendar->events().first(), KCalCore::iTIPRequest);
 
-    return format.toString(calendar).toStdString();
+    return Conversion::toStdString(format.toString(calendar));
     
 }
 
@@ -52,7 +52,7 @@ std::vector< Event > fromICalEvents(const std::string &input)
 {
     KCalCore::Calendar::Ptr calendar(new KCalCore::MemoryCalendar(Kolab::Conversion::getTimeSpec(true, std::string())));
     KCalCore::ICalFormat format;
-    format.fromString(calendar, QString::fromStdString(input));
+    format.fromString(calendar, Conversion::fromStdString(input));
     std::vector<Event> events;
     foreach (const KCalCore::Event::Ptr &event, calendar->events()) {
         events.push_back(Conversion::fromKCalCore(*event));
@@ -99,7 +99,7 @@ std::string ITipHandler::toITip(const Event &event, ITipHandler::ITipMethod meth
  * I think DTSTAMP should be the current timestamp, and CREATED should be the creation date.
  */
     KCalCore::Event::Ptr e = Conversion::toKCalCore(event);
-    return format.createScheduleMessage(e, m).toStdString();
+    return Conversion::toStdString(format.createScheduleMessage(e, m));
 }
 
 
@@ -107,7 +107,7 @@ std::vector< Event > ITipHandler::fromITip(const std::string &string)
 {
     KCalCore::Calendar::Ptr calendar(new KCalCore::MemoryCalendar(KDateTime::Spec(KDateTime::UTC)));
     KCalCore::ICalFormat format;
-    KCalCore::ScheduleMessage::Ptr msg= format.parseScheduleMessage(calendar, QString::fromStdString(string));
+    KCalCore::ScheduleMessage::Ptr msg= format.parseScheduleMessage(calendar, Conversion::fromStdString(string));
     KCalCore::Event::Ptr event = msg->event().dynamicCast<KCalCore::Event>();
     std::vector< Event > events;
     events.push_back(Conversion::fromKCalCore(*event));
@@ -133,13 +133,13 @@ std::string ITipHandler::toIMip(const Event &event , ITipHandler::ITipMethod m,
         method == KCalCore::iTIPCancel ||
         method == KCalCore::iTIPAdd ||
         method == KCalCore::iTIPDeclineCounter ) {
-        return QString(mailAttendees(e, bccMe, messageText)).toStdString();
+        return Conversion::toStdString(QString(mailAttendees(e, bccMe, messageText)));
     } else {
         QString subject;
         if ( e && method == KCalCore::iTIPCounter ) {
             subject = QString( "Counter proposal: %1" ).arg(e->summary());
         }
-        return QString(mailOrganizer( e, QString::fromStdString(from), bccMe, messageText, subject)).toStdString();
+        return Conversion::toStdString(QString(mailOrganizer( e, Conversion::fromStdString(from), bccMe, messageText, subject)));
     }
     return std::string();
 }
@@ -147,7 +147,7 @@ std::string ITipHandler::toIMip(const Event &event , ITipHandler::ITipMethod m,
 std::vector< Event > ITipHandler::fromIMip(const std::string &input)
 {
     KMime::Message::Ptr msg = KMime::Message::Ptr(new KMime::Message);
-    msg->setContent( QString::fromStdString(input).toLatin1() );
+    msg->setContent( Conversion::fromStdString(input).toUtf8() );
     msg->parse();
     msg->content(KMime::ContentIndex());
 
@@ -156,7 +156,7 @@ std::vector< Event > ITipHandler::fromIMip(const std::string &input)
         qWarning() << "could not find text/calendar part";
         return std::vector< Event >();
     }
-    return fromITip(QString(c->decodedContent()).toStdString());
+    return fromITip(Conversion::toStdString(QString(c->decodedContent())));
 }
 
 
diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index ddbb306..fc97715 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -33,6 +33,7 @@
 #include <conversion/kcalconversion.h>
 #include <conversion/kabcconversion.h>
 #include <conversion/kolabconversion.h>
+#include <conversion/commonconversion.h>
 #include <akonadi/notes/noteutils.h>
 #include <kolabformat.h>
 
@@ -138,6 +139,7 @@ Kolab::ObjectType getObjectType(const QString &type)
     } else if (type.contains(dictKolabType())) { //Previous versions appended the language to the type
         return DictionaryConfigurationObject;
     }
+    Warning() << "Unknown object type: " << type;
     return Kolab::InvalidObject;
 }
 
@@ -301,9 +303,9 @@ ObjectType KolabObjectReader::Private::readKolabV3(const KMime::Message::Ptr &ms
             const Kolab::Dictionary &dictionary = configuration.dictionary();
             mDictionary.clear();
             foreach (const std::string &entry, dictionary.entries()) {
-                mDictionary.append(QString::fromStdString(entry));
+                mDictionary.append(Conversion::fromStdString(entry));
             }
-            mDictionaryLanguage = QString::fromStdString(dictionary.language());
+            mDictionaryLanguage = Conversion::fromStdString(dictionary.language());
         }
             break;
         case FreebusyObject: {
@@ -346,7 +348,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             printMessageDebugInfo(msg);
             return InvalidObject;
         }
-        const QString &kolabType = xKolabHeader->asUnicodeString();
+        const QString &kolabType = xKolabHeader->asUnicodeString().trimmed();
         objectType = getObjectType(kolabType);
     } else {
         objectType = d->mOverrideObjectType;
@@ -478,12 +480,12 @@ KMime::Message::Ptr KolabObjectWriter::writeEvent(const KCalCore::Event::Ptr &i,
     if (v == KolabV3) {
         KCalCore::Event::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Event>();
         const Kolab::Event &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeEvent(incidence, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeEvent(incidence, std::string(getProductId(productId).toUtf8().constData()));
         ErrorHandler::handleLibkolabxmlErrors();
-        return Mime::createMessage(ic, xCalMimeType(), eventKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return Mime::createMessage(ic, xCalMimeType(), eventKolabType(), QString::fromUtf8(v3String.c_str()).toUtf8(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Event::eventToXML(i, tz);
-    return Mime::createMessage(i, eventKolabType(), eventKolabType(), xml.toLatin1(), false, getProductId(productId));
+    return Mime::createMessage(i, eventKolabType(), eventKolabType(), xml.toUtf8(), false, getProductId(productId));
 }
 
 KMime::Message::Ptr KolabObjectWriter::writeTodo(const KCalCore::Todo::Ptr &i, Version v, const QString &productId, const QString &tz)
@@ -497,12 +499,12 @@ KMime::Message::Ptr KolabObjectWriter::writeTodo(const KCalCore::Todo::Ptr &i, V
     if (v == KolabV3) {
         KCalCore::Todo::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Todo>();
         const Kolab::Todo &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeTodo(incidence, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeTodo(incidence, Conversion::toStdString(getProductId(productId)));
         ErrorHandler::handleLibkolabxmlErrors();
-        return Mime::createMessage(ic, xCalMimeType(), todoKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return Mime::createMessage(ic, xCalMimeType(), todoKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Task::taskToXML(i, tz);
-    return Mime::createMessage(i, todoKolabType(), todoKolabType(), xml.toLatin1(), false, getProductId(productId));
+    return Mime::createMessage(i, todoKolabType(), todoKolabType(), xml.toUtf8(), false, getProductId(productId));
 }
 
 KMime::Message::Ptr KolabObjectWriter::writeJournal(const KCalCore::Journal::Ptr &i, Version v, const QString &productId, const QString &tz)
@@ -516,12 +518,12 @@ KMime::Message::Ptr KolabObjectWriter::writeJournal(const KCalCore::Journal::Ptr
     if (v == KolabV3) {
         KCalCore::Journal::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Journal>();
         const Kolab::Journal &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeJournal(incidence, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeJournal(incidence, Conversion::toStdString(getProductId(productId)));
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(ic, xCalMimeType(), journalKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return  Mime::createMessage(ic, xCalMimeType(), journalKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Journal::journalToXML(i, tz);
-    return Mime::createMessage(i, journalKolabType(), journalKolabType(), xml.toLatin1(), false, getProductId(productId));
+    return Mime::createMessage(i, journalKolabType(), journalKolabType(), xml.toUtf8(), false, getProductId(productId));
 }
 
 KMime::Message::Ptr KolabObjectWriter::writeIncidence(const KCalCore::Incidence::Ptr &i, Version v, const QString& productId, const QString& tz)
@@ -549,9 +551,9 @@ KMime::Message::Ptr KolabObjectWriter::writeContact(const KABC::Addressee &addre
     ErrorHandler::clearErrors();
     if (v == KolabV3) {
         const Kolab::Contact &contact = Kolab::Conversion::fromKABC(addressee);
-        const std::string &v3String = Kolab::writeContact(contact, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeContact(contact, Conversion::toStdString(getProductId(productId)));
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(addressee, xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return  Mime::createMessage(addressee, xCardMimeType(), contactKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
     }
     KolabV2::Contact contact(&addressee);
     return contactToKolabFormat(contact, getProductId(productId));
@@ -562,9 +564,9 @@ KMime::Message::Ptr KolabObjectWriter::writeDistlist(const KABC::ContactGroup &d
     ErrorHandler::clearErrors();
     if (v == KolabV3) {
         const Kolab::DistList &dist = Kolab::Conversion::fromKABC(distlist);
-        const std::string &v3String = Kolab::writeDistlist(dist, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeDistlist(dist, Conversion::toStdString(getProductId(productId)));
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(QString::fromStdString(dist.uid()), xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return  Mime::createMessage(Conversion::fromStdString(dist.uid()), xCardMimeType(), contactKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
     }
     KolabV2::DistributionList d(&distlist);
     return distListToKolabFormat(d, getProductId(productId));
@@ -580,9 +582,9 @@ KMime::Message::Ptr KolabObjectWriter::writeNote(const KMime::Message::Ptr &note
     Q_ASSERT(note.get());
     if (v == KolabV3) {
         const Kolab::Note &n = Kolab::Conversion::fromNote(note);
-        const std::string &v3String = Kolab::writeNote(n, getProductId(productId).toStdString());
+        const std::string &v3String = Kolab::writeNote(n, Conversion::toStdString(getProductId(productId)));
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(QString::fromStdString(n.uid()), kolabMimeType(), noteKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+        return  Mime::createMessage(Conversion::fromStdString(n.uid()), kolabMimeType(), noteKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
     }
     return noteToKolab(note, getProductId(productId));
 }
@@ -594,16 +596,16 @@ KMime::Message::Ptr KolabObjectWriter::writeDictionary(const QStringList &entrie
         Critical() << "only v3 implementation available";
     }
 
-    Kolab::Dictionary dictionary(lang.toStdString());
+    Kolab::Dictionary dictionary(Conversion::toStdString(lang));
     std::vector <std::string> ent;
     foreach (const QString &e, entries) {
-        ent.push_back(e.toStdString());
+        ent.push_back(Conversion::toStdString(e));
     }
     dictionary.setEntries(ent);
     Kolab::Configuration configuration(dictionary); //TODO preserve creation/lastModified date
-    const std::string &v3String = Kolab::writeConfiguration(configuration, getProductId(productId).toStdString());
+    const std::string &v3String = Kolab::writeConfiguration(configuration, Conversion::toStdString(getProductId(productId)));
     ErrorHandler::handleLibkolabxmlErrors();
-    return  Mime::createMessage(QString::fromStdString(configuration.uid()), kolabMimeType(), dictKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+    return  Mime::createMessage(Conversion::fromStdString(configuration.uid()), kolabMimeType(), dictKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
 }
 
 KMime::Message::Ptr KolabObjectWriter::writeFreebusy(const Freebusy &freebusy, Version v, const QString& productId)
@@ -612,9 +614,9 @@ KMime::Message::Ptr KolabObjectWriter::writeFreebusy(const Freebusy &freebusy, V
     if (v != KolabV3) {
         Critical() << "only v3 implementation available";
     }
-    const std::string &v3String = Kolab::writeFreebusy(freebusy, getProductId(productId).toStdString());
+    const std::string &v3String = Kolab::writeFreebusy(freebusy, Conversion::toStdString(getProductId(productId)));
     ErrorHandler::handleLibkolabxmlErrors();
-    return  Mime::createMessage(QString::fromStdString(freebusy.uid()), xCalMimeType(), freebusyKolabType(), QString::fromStdString(v3String).toLatin1(), true, getProductId(productId));
+    return  Mime::createMessage(Conversion::fromStdString(freebusy.uid()), xCalMimeType(), freebusyKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
 }
 
 
diff --git a/tests/kcalconversiontest.cpp b/tests/kcalconversiontest.cpp
index 35f4c99..cbbc861 100644
--- a/tests/kcalconversiontest.cpp
+++ b/tests/kcalconversiontest.cpp
@@ -327,7 +327,7 @@ void KCalConversionTest::testConversion_data()
         kolab.setCreated(date);
         kolab.setLastModified(date);
         kolab.setStart(date);
-        kolab.setSummary("äöü%@$£é¤¼²°€Š�");
+        kolab.setSummary(std::string(QString("äöü%@$£é¤¼²°€Š�").toUtf8().constData()));
         
         QTest::newRow("latin1+Unicode") << kcal << kolab;
 
diff --git a/tests/testfiles/v2/contacts/iso8859-1.mime b/tests/testfiles/v2/contacts/iso8859-1.mime
new file mode 100644
index 0000000..d715255
--- /dev/null
+++ b/tests/testfiles/v2/contacts/iso8859-1.mime
@@ -0,0 +1,79 @@
+From: Johnny Test <test at kolab.org>
+Organization: Kolab Systems
+Subject: UID
+Date: Wed, 1 Apr 2012 16:16:14 +0200
+User-Agent: KMail/1.13.6 (Linux/2.6.35.12-88.fc14.x86_64; KDE/4.5.5; x86_64; ; )
+MIME-Version: 1.0
+X-Kolab-Type: application/x-vnd.kolab.contact
+Content-Type: Multipart/Mixed;
+  boundary="Boundary-00=_uAbpNCARn9odR01"
+Status: RO
+X-Status: OT
+X-KMail-EncryptionState:
+X-KMail-SignatureState:
+X-KMail-MDN-Sent:
+X-UID: 0
+
+--Boundary-00=_uAbpNCARn9odR01
+Content-Type: Text/Plain;
+  charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+Content-Disposition:
+
+Dies ist ein Kolab Groupware-Objekt.
+Um dieses Objekt anzeigen zu k=F6nnen, brauchen Sie ein E-Mail Programm, da=
+s das Kolab Groupware-Format versteht.
+Eine Liste solcher E-Mail-Programme finden Sie hier:
+http://www.kolab.org/kolab2-clients.html
+
+=2D----------------------------------------------------
+
+This is a Kolab Groupware object.
+To view this object you will need an email client that can understand the K=
+olab Groupware format.
+=46or a list of such email clients please visit
+http://www.kolab.org/kolab2-clients.html
+--Boundary-00=_uAbpNCARn9odR01
+Content-Type: application/x-vnd.kolab.contact;
+  name="kolab.xml"
+Content-Transfer-Encoding: quoted-printable
+Content-Disposition: attachment;
+  filename="kolab.xml"
+
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<contact version=3D"1.0">
+ <product-id>KAddressBook 3.3, Kolab resource</product-id>
+ <uid>UID</uid>
+ <sensitivity>public</sensitivity>
+ <name>
+  <given-name>John</given-name>
+  <last-name>Doe</last-name>
+  <full-name>John Doe</full-name>
+ </name>
+ <organization>org</organization>
+ <web-page>webpage.com</web-page>
+ <department>f=C3=BCr test</department>
+ <phone>
+  <type>business1</type>
+  <number>00000000</number>
+ </phone>
+ <phone>
+  <type>businessfax</type>
+  <number>+000000</number>
+ </phone>
+ <email>
+  <display-name>John Doe</display-name>
+  <smtp-address>doe at kolab.org</smtp-address>
+ </email>
+ <address>
+  <type>home</type>
+  <x-kde-type>16</x-kde-type>
+  <street>strasse</street>
+  <locality>locality</locality>
+  <postal-code>23424</postal-code>
+  <country>country</country>
+ </address>
+ <preferred-address>home</preferred-address>
+</contact>
+
+--Boundary-00=_uAbpNCARn9odR01--
\ No newline at end of file
diff --git a/tests/testfiles/v2/event/iso8859-1.mime b/tests/testfiles/v2/event/iso8859-1.mime
new file mode 100644
index 0000000..1c6489a
--- /dev/null
+++ b/tests/testfiles/v2/event/iso8859-1.mime
@@ -0,0 +1,48 @@
+Date: Tue, 01 Sep 2009 13:36:50 +0200
+X-Kolab-Type: application/x-vnd.kolab.event
+User-Agent: Akonadi Kolab Proxy Resource
+Content-Type: multipart/mixed; boundary="nextPart3915010.RBqxP67orN"
+Subject: KOrganizer-1353608432.168
+MIME-Version: 1.0
+
+
+--nextPart3915010.RBqxP67orN
+Content-Type: text/plain; charset="iso-8859-1"
+Content-Transfer-Encoding: 7Bit
+
+Dies ist ein Kolab Groupware-Objekt.
+Um dieses Objekt anzeigen zu k=F6nnen, brauchen Sie ein E-Mail Programm, da=
+s das Kolab Groupware-Format versteht.
+Eine Liste solcher E-Mail-Programme finden Sie hier:
+http://www.kolab.org/kolab2-clients.html
+
+=2D----------------------------------------------------
+
+This is a Kolab Groupware object.
+To view this object you will need an email client that can understand the K=
+olab Groupware format.
+=46or a list of such email clients please visit
+http://www.kolab.org/kolab2-clients.html
+--nextPart3915010.RBqxP67orN
+Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
+Content-Transfer-Encoding: quoted-printable
+Content-Disposition: attachment; filename="kolab.xml"
+
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<event version=3D"1.0">
+ <product-id>Libkolab-0.1.0, Kolab resourcef=C3=BCr</product-id>
+ <uid>KOrganizer-1353608432.168</uid>
+ <creation-date>2009-09-01T11:36:44Z</creation-date>
+ <last-modification-date>2009-09-01T11:36:44Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <start-date>2009-09-02T06:00:00Z</start-date>
+ <summary>Simplef=C3=BCr Event</summary>
+ <location>Heref=C3=BCr</location>
+ <organizer/>
+ <show-time-as>busy</show-time-as>
+ <end-date>2009-09-02T07:00:00Z</end-date>
+</event>
+
+--nextPart3915010.RBqxP67orN--
+
+
diff --git a/tests/upgradetest.cpp b/tests/upgradetest.cpp
index c68f475..ee376be 100644
--- a/tests/upgradetest.cpp
+++ b/tests/upgradetest.cpp
@@ -52,6 +52,7 @@ void UpgradeTest::testIncidence_data()
     QTest::newRow( "v2journalComplex" ) << Kolab::JournalObject << TESTFILEDIR+QString::fromLatin1("v2/journal/complex.ics.mime") << false;
 
     QTest::newRow( "v2eventSimple_missingTypeHeader" ) << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/simple_missingTypeHeader.ics.mime") << true;
+    QTest::newRow( "v2eventis8859-1" ) << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/iso8859-1.mime") << false;
     
 }
 
@@ -136,6 +137,7 @@ void UpgradeTest::testContact_data()
     QTest::newRow( "v2contactEmails" )<< Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/emails.vcf.mime");
     QTest::newRow( "v2contactPhonenumber" )<< Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/phonenumbers.vcf.mime");
     QTest::newRow( "v2contactPicture" )<< Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/picture.vcf.mime");
+    QTest::newRow( "v2iso8859-1" )<< Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/iso8859-1.mime");
     
 }
 





More information about the commits mailing list