diff --git a/ChangeLog b/ChangeLog index f3236d5453..0d26a0e940 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 32f9150ba8..3964d68ec3 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -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 /**