Commit 368e78ff authored by Andreas Brodowski's avatar Andreas Brodowski

ZP-1230 windows-phone-8.1-unable-to-sync. Released under the Affero GNU...

ZP-1230 windows-phone-8.1-unable-to-sync. Released under the Affero GNU General Public License (AGPL) version 3.

Changed according to input from Manfred
parent d0167f10
......@@ -2479,7 +2479,7 @@ class MAPIProvider {
else {
$body = $this->mapiReadStream($stream, $streamsize);
$message->asbody->data = StringStreamWrapper::Open(Utils::ConvertCodepageStringToUtf8($message->internetcpid, str_replace("\n","",str_replace("\r","",$body))));
$message->internetcpid = 65001;
$message->internetcpid = INTERNET_CPID_UTF8;
}
}
else {
......
......@@ -788,7 +788,7 @@ class Utils {
public static function ConvertCodepageStringToUtf8($codepage, $string) {
if (function_exists("iconv")) {
$charset = self::GetCodepageCharset($codepage);
return iconv($charset, "utf-8", str_replace($charset,"utf-8",$string));
return iconv($charset, "utf-8", preg_replace('/<head(.*)<meta (.*)?charset=([^"\']+)(.*)<\/head/i','<head$1<meta $2charset=utf-8$4</head',$string,1));
}
else
ZLog::Write(LOGLEVEL_WARN, "Utils::ConvertCodepageStringToUtf8() 'iconv' is not available. Charset conversion skipped.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment