Suitecrm: Encoding issue with umlauts on email update in case

Created on 26 Feb 2018  路  2Comments  路  Source: salesagility/SuiteCRM

Issue

If I send an email from outlook with umlauts to create or update a case, then the encoding of the text is wrong.

Expected Behavior

Encoding should be right.

Actual Behavior

Currently it looks like:
grafik

Possible Fix

Looks like the issue starts with the commit:
https://github.com/salesagility/SuiteCRM/commit/34236b845dbb8347d3c8118effb8e1837c692710

After calling parseDescription() in modules/AOP_Case_Updates/AOP_Case_Updates.php (Line 117 ff.) the description text is HTML decoded and it will be saved into the DB. The issues is caused within the DOM manipulation inside the parseDescription function.

public function save($check_notify = false)
    {
        $this->name = SugarCleaner::cleanHtml($this->name);
        $this->parseDescription();
        parent::save($check_notify);

If I replace $this->parseDescription(); with $this->description = SugarCleaner::cleanHtml($this->description); everything works fine.

Steps to Reproduce

  1. Send an email with umlauts to the SuiteCRM inbox to create a new case
  2. Go to the new created case
  3. Check case updates for correct encoding

Context

Has to be fixed, otherwise the case updates are wrong encoded.

Your Environment

  • SuiteCRM Version used: 7.9.14
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.1
Important Fix Proposed Bug

Most helpful comment

Proposed fix in modules/AOP_Case_Updates/AOP_Case_Updates.php line 144:

Actual:
$dom->loadHTML($description);

Fix:
$dom->loadHTML(mb_convert_encoding($description, 'HTML-ENTITIES', 'UTF-8'));

All 2 comments

Proposed fix in modules/AOP_Case_Updates/AOP_Case_Updates.php line 144:

Actual:
$dom->loadHTML($description);

Fix:
$dom->loadHTML(mb_convert_encoding($description, 'HTML-ENTITIES', 'UTF-8'));

I have the same issue. The fix works fine for me.

Was this page helpful?
0 / 5 - 0 ratings