Setlocale (LC_ALL, 'en_GB.UTF8') does not work on windows

Why setlocale(LC_ALL, 'en_GB.UTF8');returns false in Windows Server 2003 R2 - Zend CE PHP 5.3.5?

The function in question: setlocale.

+3
source share
2 answers

From the PHP manual:

The return value setlocale()depends on the system on which PHP is running. It returns exactly what the setlocale system returns .

So, in your case, it returns false, because the system returns false. Your language is probably not available on your system.

setlocale, Windows, . eng, english-uk uk. Windows , UTF-8; , , Windows-1252.

+7

, Windows, utf-8, :

$str=strftime('%a'); //for example
if(!mb_check_encoding($str,'utf-8')) $str=utf8_encode($str);
0

Source: https://habr.com/ru/post/1662280/


All Articles