A5下载文章资讯

分类分类

Discuz!支持超大字符集的方法

2015-07-24 14:45作者:fang

为什么Ext-B的汉字会被显示成:【𠀀】,其原因是系统对&#后面超过5位数字的编码无法正确处理造成的,而Ext-B(扩展B)的汉字都是大于131071的编码,超过5位数,所以一律被显示成乱码。

Discuz! X系列修改方法

编辑source/function/function_core.php

找到

$string = preg_replace('/&((#(d{3,5}|x[a-fA-F0-9]{4}));)/', '&1', $string);

修改为

$string = preg_replace('/&((#(d{3,7}|x[a-fA-F0-9]{4}));)/', '&1', $string);

即可。

Discuz!7.x修改方法

编辑include/global.func.php(Discuz!6.x及以前版本修改/include/global.inc.php)

找到

$string = preg_replace('/&((#(d{3,5}|x[a-fA-F0-9]{4}));)/', '&1',

修改为

$string = preg_replace('/&((#(d{3,7}|x[a-fA-F0-9]{4}));)/', '&1',

即可。

展开全部

相关

说两句网友评论
    我要跟贴
    取消