setlocale(LC_ALL,'en_GB.UTF8')在Windows上不起作用 [英] setlocale(LC_ALL, 'en_GB.UTF8') not working on windows

查看:749
本文介绍了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字符串列表可用

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上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆