mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
fix : control character cause qdomdocument can not parse attribute
This commit is contained in:
parent
3ed7ce5ccb
commit
9ea83f1299
|
@ -336,6 +336,9 @@ bool MdictParser::readHeader( QDataStream & in )
|
||||||
headerTextUtf16.clear();
|
headerTextUtf16.clear();
|
||||||
in.setByteOrder( QDataStream::BigEndian );
|
in.setByteOrder( QDataStream::BigEndian );
|
||||||
|
|
||||||
|
//with this control character ,qt6.x can not parse attribute value.
|
||||||
|
headerText.remove(QRegularExpression("\\p{C}"));
|
||||||
|
|
||||||
QDomNamedNodeMap headerAttributes = parseHeaderAttributes( headerText );
|
QDomNamedNodeMap headerAttributes = parseHeaderAttributes( headerText );
|
||||||
|
|
||||||
encoding_ = headerAttributes.namedItem( "Encoding" ).toAttr().value();
|
encoding_ = headerAttributes.namedItem( "Encoding" ).toAttr().value();
|
||||||
|
|
Loading…
Reference in a new issue