centos8 安装 oniguruma-devel

Package 'oniguruma', required by 'virtual:world', not found

configure: error: Package requirements (oniguruma) were not met:

需要使用这个命令安装

dnf --enablerepo=PowerTools install oniguruma-devel

或(如果报错)

dnf --enablerepo=powertools install oniguruma-devel

如果是 rockylinux:

dnf install --enablerepo=devel -y oniguruma-devel 

在 CDATA 节中找到无效的 XML 字符 (Unicode: 0x1f)

https://blog.csdn.net/dufufd/article/details/53895764

在 CDATA 节中找到无效的 XML 字符 (Unicode: 0x1f)

String could not be parsed as XML

解析XML文件时,会碰到程序发生以下一些异常信息: 

在 CDATA 节中找到无效的 XML 字符 (Unicode: 0x1f)。

或者:

An invalid XML character (Unicode: 0x1f) was found in the CDATA section.

这些错误的发生是由于一些不可见的特殊字符的存在,而这些字符对于XML文件来说又是非法的,所以XML解析器在解析时会发生异常,官方定义了XML的无效字符分为三段: 

0x00 – 0x08

0x0b – 0x0c

0x0e – 0x1f

解决方法是:在解析之前先把字符串中的这些非法字符过滤掉即可, 不会影响原来文本的内容。

即:string.replaceAll(“[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]”, “”) ;

# php 版过滤方法
$content2 = preg_replace(‘/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/mu’, ”, $content);

另外:这些字符即使放在CDATA中仍然解析不了,所以最好的办法是过滤掉。