Add a comment to wc_ascii_uasort_comparison explaining why setlocale is needed.

This commit is contained in:
Nestor Soriano 2021-01-14 11:16:42 +01:00
parent 9d892f0678
commit c9ea5922e2
1 changed files with 2 additions and 0 deletions

View File

@ -1771,6 +1771,8 @@ function wc_uasort_comparison( $a, $b ) {
* @return int
*/
function wc_ascii_uasort_comparison( $a, $b ) {
// 'setlocale' is required for compatibility with PHP 8.
// Without it, 'iconv' will return '?'s instead of transliterated characters.
$prev_locale = setlocale( LC_CTYPE, 0 );
setlocale( LC_ALL, 'C.UTF-8' );