我有一个页面,它的编码是 UTF-8,如果我尝试在 unix 系统中运行该代码,一切看起来都很好,但是当我尝试在 windows(7) 中运行时,一些字符看起来是问号 (�)。如何在两个系统上都运行良好的代码(不使用 iconv)。
header('Content-Type: text/html; charset=UTF-8');
setlocale(LC_ALL, 'turkish');
echo strftime("%d %B %Y, %H:%M");
最佳答案
Microsoft Windows 不支持 UTF-8 语言环境。因此,如果您提供土耳其语言环境,它会显示一个允许表示特定语言的 8 位代码页。
例如,对于语言环境希伯来语,它将是 pic codepage-1255,对于土耳其语,它可能是 1254。
因此,您不能在 MS-Windows 平台下使用它。
How can run the code fine both of two system(without using iconv).
可能在 MS Windows 下使用非 utf8 编码。
关于php - Unicode setlocale 和 strftime 在 Windows 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2197168/