summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/serialbus/qcandbcfileparser.cpp7
-rw-r--r--tests/auto/qcandbcfileparser/data/char_string_test.dbc2
-rw-r--r--tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp2
3 files changed, 5 insertions, 6 deletions
diff --git a/src/serialbus/qcandbcfileparser.cpp b/src/serialbus/qcandbcfileparser.cpp
index 63d4f98..c32c9bb 100644
--- a/src/serialbus/qcandbcfileparser.cpp
+++ b/src/serialbus/qcandbcfileparser.cpp
@@ -306,9 +306,8 @@ static constexpr auto kMaybeSpaceRegExp = "[ ]*"_L1;
static constexpr auto kMuxIndicatorRegExp = "M|m\\d+M?"_L1;
static constexpr auto kByteOrderRegExp = "0|1"_L1;
static constexpr auto kValueTypeRegExp = "\\+|\\-"_L1;
-// The pattern matches all ASCII characters in range 0x20 - 0x7E, except
-// double-quote (") and backslash (\).
-static constexpr auto kCharStrRegExp = "((?![\\\"\\\\])[\x20-\x7e])*"_L1;
+// The pattern matches all printable characters, except double-quote (") and backslash (\).
+static constexpr auto kCharStrRegExp = "((?![\\\"\\\\])\\P{Cc})*"_L1;
void QCanDbcFileParserPrivate::reset()
{
@@ -341,7 +340,7 @@ bool QCanDbcFileParserPrivate::parseFile(const QString &fileName)
m_seenExtraData = false;
while (!f.atEnd()) {
- const QString str = QString::fromLatin1(f.readLine().trimmed());
+ const QString str = QString::fromUtf8(f.readLine().trimmed());
if (!processLine({str.constData(), str.size()})) // also sets the error properly
return false;
}
diff --git a/tests/auto/qcandbcfileparser/data/char_string_test.dbc b/tests/auto/qcandbcfileparser/data/char_string_test.dbc
index 7b2fb7e..34460b2 100644
--- a/tests/auto/qcandbcfileparser/data/char_string_test.dbc
+++ b/tests/auto/qcandbcfileparser/data/char_string_test.dbc
@@ -1,4 +1,4 @@
BO_ 1234 Test : 8 Vector__XXX
- SG_ s0 : 0|8@1+ (1,0) [0|0] " !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~" Vector__XXX
+ SG_ s0 : 0|8@1+ (1,0) [0|0] " !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~°" Vector__XXX
SG_ s1 : 0|8@1+ (1,0) [0|0] "double quote: "" Vector__XXX
SG_ s2 : 0|8@1+ (1,0) [0|0] "backslash: \" Vector__XXX
diff --git a/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp b/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
index 260da11..17301cc 100644
--- a/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
+++ b/tests/auto/qcandbcfileparser/tst_qcandbcfileparser.cpp
@@ -745,7 +745,7 @@ void tst_QCanDbcFileParser::parseFile_data()
signalDesc.setOffset(0.0);
signalDesc.setRange(0.0, 0.0);
signalDesc.setPhysicalUnit(" !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "[]^_`abcdefghijklmnopqrstuvwxyz{|}~");
+ "[]^_`abcdefghijklmnopqrstuvwxyz{|}~°");
signalDesc.setReceiver("Vector__XXX");
messageDesc.addSignalDescription(signalDesc);