Use charset from mail part

This commit is contained in:
Alexandros Sigalas 2019-04-01 09:15:09 +03:00
parent 5c3a4fe6ce
commit f208af8dfb

View File

@ -1698,7 +1698,7 @@ class Mail
$_structure=$part;
$this->fetchPartContents($uid, $_structure, false,true);
$headerObject['BODYPREVIEW']=trim(str_replace(array("\r\n","\r","\n"),' ',mb_substr(Mail\Html::convertHTMLToText($_structure->getContents()),0,((int)$_fetchPreviews<300?300:$_fetchPreviews))));
$charSet=Translation::detect_encoding($headerObject['BODYPREVIEW']);
$charSet = $part->getCharset();
// add line breaks to $bodyParts
//error_log(__METHOD__.' ('.__LINE__.') '.' Charset:'.$bodyParts[$i]['charSet'].'->'.$bodyParts[$i]['body']);
$headerObject['BODYPREVIEW'] = Translation::convert_jsonsafe($headerObject['BODYPREVIEW'], $charSet);