diff --git a/ActiveSync/SOGoMailObject+ActiveSync.m b/ActiveSync/SOGoMailObject+ActiveSync.m index e5f349092..e111b9edb 100644 --- a/ActiveSync/SOGoMailObject+ActiveSync.m +++ b/ActiveSync/SOGoMailObject+ActiveSync.m @@ -67,8 +67,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include - #include +#include typedef struct { uint32_t dwLowDateTime; @@ -323,6 +323,11 @@ struct GlobalObjectId { if (s) { + // We sanitize the content immediately, in case we have non-UNICODE safe + // characters that would be re-encoded later in HTML entities and thus, + // ignore afterwards. + s = [s safeString]; + body = [s dataUsingEncoding: NSUTF8StringEncoding]; }