Skip to content

Commit

Permalink
Use charset from mail part
Browse files Browse the repository at this point in the history
  • Loading branch information
asig2016 committed Apr 1, 2019
1 parent 5c3a4fe commit f208af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ function getHeaders($_folderName, $_startMessage, $_numberOfMessages, $_sort, $_
$_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);
Expand Down

0 comments on commit f208af8

Please sign in to comment.