bug #4207 json_encode error due to strftime returning non utf8 chars in Windows 8.1 Chinese version

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne 2015-04-14 22:56:00 +05:30
parent fe3a103767
commit 0f3840138f
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog
4.4.3.0 (not yet released)
- bug #4851 PHP errors in login dialogue
- bug #4207 json_encode error due to strftime returning non utf8 chars in Windows 8.1 Chinese version
4.4.2.0 (2015-04-13)
- bug #4835 PMA_hideShowConnection not called after submit_num_fields

View File

@ -1610,7 +1610,14 @@ class PMA_Util
$date
);
return strftime($date, $timestamp);
$ret = strftime($date, $timestamp);
// Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8
// output here. See https://sourceforge.net/p/phpmyadmin/bugs/4207/
if (mb_detect_encoding($ret, 'UTF-8', true) != 'UTF-8') {
$ret = date('Y-m-d H:i:s', $timestamp);
}
return $ret;
} // end of the 'localisedDate()' function
/**