如何在 Qt 中取消转义 XML? [英] How to unescape XML in Qt?

查看:25
本文介绍了如何在 Qt 中取消转义 XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 QString"< foo & blah >"(没有标签,只有字符数据),我想转义它.Qt 命名空间中有 Qt::escape 函数,但没有反向对应.

I have QString like "< foo & blah >" (no tags, only character data) and I want to unescape it. There is Qt::escape function in Qt namespace, yet no reverse counterpart for it.

那么,如何在 Qt 中取消转义 XML 字符串?

So, how can I unescape XML string in Qt?

具体要求:Qt 4.7.3 必须可以实现.

Specific requirement: it must be possible with Qt 4.7.3.

推荐答案

看起来有人制作了一个 html 实体解码器来回答一个旧帖子.如果您不介意引入新的依赖项,那可能是一个不错的解决方案.

It looks like someone made an html entity decoder in an answer to an old post. If you don't mind introducing a new dependency, that might be a good solution.

这篇关于如何在 Qt 中取消转义 XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆