将php版本从5.6升级到7.2后,阿拉伯字符更改为问号

问题描述 投票:0回答:1

我有一个wordpress网站,当我尝试将wordpress版本更新到5.4时,它要求我升级PHP版本。我从服务器进行了升级,当我在更新wordpress之前回到网站时,我看到网站上所有用阿拉伯语写的字符都变成了问号。然后,我将wordpress更新为5.4,没有任何变化。我检查了wp-config.php文件,发现字符集设置为utf8

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

但是MySQL数据库设置为

enter image description here

另外,我检查了网页标题

<html dir="rtl" lang="ar">
<head>
<meta charset="UTF-8" />

然后,我在php.ini文件夹中的public_html文件中添加了以下两行

default_charset = "UTF-8"
mbstring.internal_encoding = UTF-8

例如,在标签部分的图像下方

enter image description here

mysql wordpress unicode character collation
1个回答
0
投票

连接参数必须与客户端中的编码一致。

无法使用latin1正确处理阿拉伯语。

问号在INSERTing数据期间发生;数据丢失。

有关“问号”的原因列表,请参见Trouble with UTF-8 characters; what I see is not what I stored

© www.soinside.com 2019 - 2024. All rights reserved.