setlocale(LC_ALL, #39;en_GB.UTF8#39;) not working on windows(setlocale(LC_ALL, en_GB.UTF8) 不适用于 Windows)
问题描述
为什么 setlocale(LC_ALL, 'en_GB.UTF8');
在 Windows Server 2003 R2 - Zend CE PHP 5.3.5 上返回 false ?
Why does setlocale(LC_ALL, 'en_GB.UTF8');
return false on Windows Server 2003 R2 - Zend CE PHP 5.3.5 ?
有问题的函数:setlocale
.
Function in question: setlocale
.
推荐答案
来自 PHP 手册:
setlocale()
的返回值取决于 PHP 运行的系统.它准确返回系统 setlocale 函数返回的内容.
The return value of
setlocale()
depends on the system that PHP is running. It returns exactly what the system setlocale function returns.
因此,在您的情况下,它返回 false,因为系统返回 false.您使用的区域设置可能在您的系统上不可用.
So in your case it returns false because the system returns false. It is likely that the locale you're using is not available on your system.
Windows 支持的 setlocale
字符串列表可用 此处.对于英式英语,您需要 engcode>、
english-uk
或 uk
.不过,Windows 不支持像 UTF-8 这样的多字节字符集;您可能最终会使用 Windows-1252.
A list of setlocale
strings supported by Windows is available here. For British English you want eng
, english-uk
, or uk
. Windows doesn't support multi-byte character sets like UTF-8 though; you will probably end up with Windows-1252.
这篇关于setlocale(LC_ALL, 'en_GB.UTF8') 不适用于 Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:setlocale(LC_ALL, 'en_GB.UTF8') 不适用于 Windows


- PHP foreach() 与数组中的数组? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01