php - UTF-8 字符集 CentOS PHP

标签 php utf-8 centos

我的 utf-8 有问题,我试图在我的页面上显示俄语字符,但我得到了????而不是那些俄罗斯字符。

我尝试像 AddDefaultCharset UTF-8 一样修改 .htaccess 但没有奏效。

我还观察到,当我尝试使用 .html 扩展名(无 php)显示字符时,它工作正常,但使用 php 文件显示 ?????。

服务器详情

php 5.3.16
centos 6.3 版

我和这里有类似的问题

http://remository.com/forum/func,view/id,18483/catid,24/

谢谢

最佳答案

在主 php.ini 中添加这些行对我有用

default_charset = "utf-8"
mbstring.internal_encoding=utf-8
mbstring.http_output=UTF-8
mbstring.encoding_translation=On
mbstring.func_overload=6

关于php - UTF-8 字符集 CentOS PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13104615/

相关文章:

php - 使用 Jquery 将字符串更改为某种固定格式

javascript - 单独打印json元素

Java nio2 目录没有关闭。导致 "too many open files"错误

docker - CentOS 7 - 无法在 unix :///var/run/docker. sock 连接到 Docker 守护程序。 docker 守护进程是否正在运行?

php - 基于数据库中时间记录的打开/关闭状态

java - 使用 Java 将 Utf-16 转换为 UTF-8 字符串并丢失数据

c# - 一个 aspx 页面具有 utf-8 编码

perl - 重载字符串化和 utf8 标志

centos - puppet 4.0 vagrant 模块丢失

php - 如何引导 Laravel 命令行脚本?