mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 08:23:12 +01:00
try to fix broken UTF-8 on message display
This commit is contained in:
parent
b60ee03504
commit
d716c8756f
@ -849,9 +849,19 @@
|
||||
//if (json_last_error() != JSON_ERROR_NONE && strlen($singleBodyPart['body'])>0)
|
||||
if ($test=="null" && strlen($sessionData['body'])>0)
|
||||
{
|
||||
// this should not be needed, unless something fails with charset detection/ wrong charset passed
|
||||
error_log(__METHOD__.__LINE__.' Charset problem detected; Charset Detected:'.felamimail_bo::detect_encoding($sessionData['body']));
|
||||
$sessionData['body'] = utf8_encode($sessionData['body']);
|
||||
// try to fix broken utf8
|
||||
$x = (function_exists('mb_convert_encoding')?mb_convert_encoding($sessionData['body'],'UTF-8','UTF-8'):(function_exists('iconv')?@iconv("UTF-8","UTF-8//IGNORE",$sessionData['body']):$sessionData['body']));
|
||||
$test = @json_encode($x);
|
||||
if ($test=="null" && strlen($sessionData['body'])>0)
|
||||
{
|
||||
// this should not be needed, unless something fails with charset detection/ wrong charset passed
|
||||
error_log(__METHOD__.__LINE__.' Charset problem detected; Charset Detected:'.felamimail_bo::detect_encoding($sessionData['body']));
|
||||
$sessionData['body'] = utf8_encode($sessionData['body']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sessionData['body'] = $x;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error_log(__METHOD__.__LINE__.$sessionData['body']);
|
||||
|
@ -1525,9 +1525,19 @@ blockquote[type=cite] {
|
||||
//if (json_last_error() != JSON_ERROR_NONE && strlen($singleBodyPart['body'])>0)
|
||||
if (($test=="null" || $test === false || is_null($test)) && strlen($singleBodyPart['body'])>0)
|
||||
{
|
||||
// this should not be needed, unless something fails with charset detection/ wrong charset passed
|
||||
error_log(__METHOD__.__LINE__.' Charset Reported:'.$singleBodyPart['charSet'].' Charset Detected:'.felamimail_bo::detect_encoding($singleBodyPart['body']));
|
||||
$singleBodyPart['body'] = utf8_encode($singleBodyPart['body']);
|
||||
// try to fix broken utf8
|
||||
$x = (function_exists('mb_convert_encoding')?mb_convert_encoding($singleBodyPart['body'],'UTF-8','UTF-8'):(function_exists('iconv')?@iconv("UTF-8","UTF-8//IGNORE",$singleBodyPart['body']):$singleBodyPart['body']));
|
||||
$test = @json_encode($x);
|
||||
if (($test=="null" || $test === false || is_null($test)) && strlen($singleBodyPart['body'])>0)
|
||||
{
|
||||
// this should not be needed, unless something fails with charset detection/ wrong charset passed
|
||||
error_log(__METHOD__.__LINE__.' Charset Reported:'.$singleBodyPart['charSet'].' Charset Detected:'.felamimail_bo::detect_encoding($singleBodyPart['body']));
|
||||
$singleBodyPart['body'] = utf8_encode($singleBodyPart['body']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$singleBodyPart['body'] = $x;
|
||||
}
|
||||
}
|
||||
}
|
||||
//error_log($singleBodyPart['body']);
|
||||
|
Loading…
Reference in New Issue
Block a user