aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTasos Sahanidis <tasos@tasossah.com>2019-05-08 00:37:49 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-05-09 09:26:49 +0200
commit3e095648fb8fb75738f6cbca568746fa160c47c8 (patch)
treeb417e121939b72bfae06984e86f14895d77b22cf
parent5b59b0fd7a5d37921c64e8640527e1180e3e289a (diff)
qv4l2: Fix UTF8 error message strings
In locales such as el_GR.UTF-8, sterror() returns localised error messages, which get printed as question marks due to the conversion in QString::toLatin1(). Calling QString::toUtf8 instead, corrects this error. Signed-off-by: Tasos Sahanidis <tasos@tasossah.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/qv4l2/qv4l2.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
index 832f479e..b52a3b60 100644
--- a/utils/qv4l2/qv4l2.cpp
+++ b/utils/qv4l2/qv4l2.cpp
@@ -1705,7 +1705,7 @@ void ApplicationWindow::error(const QString &error)
{
statusBar()->showMessage(error, 20000);
if (!error.isEmpty())
- fprintf(stderr, "%s\n", error.toLatin1().data());
+ fprintf(stderr, "%s\n", error.toUtf8().data());
}
void ApplicationWindow::error(int err)
@@ -1780,7 +1780,7 @@ static bool processShortOption(const QStringList &args, int &i, QString &dev)
return false;
if (args[i].length() == 2) {
if (i + 1 >= args.size()) {
- usageError(args[i].toLatin1());
+ usageError(args[i].toUtf8());
return false;
}
dev = args[++i];
@@ -1803,7 +1803,7 @@ static bool processLongOption(const QStringList &args, int &i, QString &dev)
return true;
}
if (i + 1 >= args.size()) {
- usageError(args[i].toLatin1());
+ usageError(args[i].toUtf8());
return false;
}
dev = args[++i];
@@ -1857,7 +1857,7 @@ int main(int argc, char **argv)
} else if (args[i] == "-R" || args[i] == "--raw") {
raw = true;
} else {
- printf("Invalid argument %s\n", args[i].toLatin1().data());
+ printf("Invalid argument %s\n", args[i].toUtf8().data());
return 0;
}
}

Privacy Policy