gpt4 book ai didi

php - setlocale(LC_ALL, 'en_GB.UTF8') 不适用于 Windows

转载 作者:可可西里 更新时间:2023-11-01 14:44:16 26 4
gpt4 key购买 nike

为什么 setlocale(LC_ALL, 'en_GB.UTF8'); 在 Windows Server 2003 R2 - Zend CE PHP 5.3.5 上返回 false?

有问题的功能:setlocale .

最佳答案

来自 PHP 手册:

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

因此在您的情况下它返回 false,因为系统返回 false。您正在使用的语言环境可能在您的系统上不可用。

列表setlocale Windows 支持的字符串可用 here .对于英式英语,您需要 eng , english-uk , 或 uk . Windows 不支持像 UTF-8 这样的多字节字符集;你可能最终会得到 Windows-1252。

关于php - setlocale(LC_ALL, 'en_GB.UTF8') 不适用于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9489339/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com