English 中文(简体)
如何清理或转换奇特 XML 字符和格式化?
原标题:How to clean up or convert odd XML characters and formatting?

我有一个 XML 文件, 包含一些奇怪的格式化, 例如 :

<?xml version=3D3D"1.0" encoding=3D3D"ISO-8859-1"?>

注意“ 3D3D ” 。 此外, 在整个文件的其余部分, 线条以78个字符打破, 并包含更多“ 3D ”, 大致如下:

Supercalifragilis=
=3D
ticexpialidocious=
=3D

起初我以为这一切都可能与ISO-8859-1编码有关,但通过 PHP s mb_convert_encoding($xml, "UTF-8", "ISO-8859-1 " ) 运行文本似乎没有改变。

有人熟悉这些奇特的字符和格式化吗?如果是这样的话,你能推荐任何快速的方法来清理它来转换它吗? 这样我就可以用简单XML之类的东西 干净地分析文件?

最佳回答

奇数是 QP (引号可打印) 编码 : =xx 表示带有十六进制代码xx的字符。 例如, = 3D 表示等号“ = ” 。 在 QP 中, 软线折号是行末的“ = ” 。 因此数据似乎是 QP 编码了 twice

因此,希望"http://www.php.net/manual/en/formation. 引号-可打印-decode.php" rel=“nofollow” 引号_可打印_decode 会有帮助。

问题回答

暂无回答




相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

How to get instance from string in C#?

Is it possible to get the property of a class from string and then set a value? Example: string s = "label1.text"; string value = "new value"; label1.text = value; <--and some code that makes ...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site ...

热门标签