From 9ea83f1299ab54226e5635320f543c3cd77f0c73 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sat, 11 Jun 2022 16:25:56 +0800 Subject: [PATCH] fix : control character cause qdomdocument can not parse attribute --- mdictparser.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mdictparser.cc b/mdictparser.cc index a4ec7142..bc8eaf90 100644 --- a/mdictparser.cc +++ b/mdictparser.cc @@ -336,6 +336,9 @@ bool MdictParser::readHeader( QDataStream & in ) headerTextUtf16.clear(); in.setByteOrder( QDataStream::BigEndian ); + //with this control character ,qt6.x can not parse attribute value. + headerText.remove(QRegularExpression("\\p{C}")); + QDomNamedNodeMap headerAttributes = parseHeaderAttributes( headerText ); encoding_ = headerAttributes.namedItem( "Encoding" ).toAttr().value();