Unreadable CLI Output #1381

buckle2000 opened this Issue Oct 22, 2016 · 6 comments


None yet

2 participants



bjorn commented Oct 24, 2016

This looks like some kind of encoding problem. Unfortunately, I am not sure how to reproduce it locally so testing a fix will be a little challenging.

It does appear that some characters do show up correctly. Could it also be that your font is missing the characters that appear as ??

@bjorn bjorn added Bug Windows labels Oct 24, 2016

I am sure my font has enough character sets.

bjorn commented Jan 13, 2017 edited

Found the reason for this bug. The answer is in the qPrintable documentation:

Note: qDebug(), qInfo(), qWarning(), qCritical(), qFatal() expect %s arguments to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding. Therefore qUtf8Printable() should be used for logging strings instead of qPrintable().

Unfortunately, qUtf8Printable was introduced with Qt 5.4, so I need to either raise the minimum Qt version of use ifdef.

@bjorn bjorn self-assigned this Jan 13, 2017
@bjorn bjorn added a commit that closed this issue Jan 14, 2017
@bjorn Fixed encoding problems with command-line output
With some languages on some systems, much of the command-line output
would be unreadable. This was seen on Windows with Chinese language. It
was likely caused by passing the result of qPrintable, which produces a
string with local 8-bit encoding, to qWarning/qDebug/etc, which expect a
UTF-8 encoded string. The problem was not generally visible on Linux,
where the local 8-bit encoding is usually UTF-8.

The code was now changed to use qUtf8Printable where appropriate, as
well as QDebug::noquote, because most of the old qPrintable usages were
to avoid the quotes.

qUtf8Printable and QDebug::noquote were added in Qt 5.4, so this is now
the minimum supported version of Qt (previously 5.2).

Closes #1381
@bjorn bjorn closed this in 6a838ac Jan 14, 2017
bjorn commented Jan 14, 2017

@buckle2000 The above fix will soon be in the snapshot builds. If possible, please check whether it is fixed.

buckle2000 commented Jan 15, 2017 edited

It is fixed. 👍

bjorn commented Jan 15, 2017

@buckle2000 Awesome, thanks for the confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment