[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/30] misc: Avoid UTF-8 in error messages
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 06/30] misc: Avoid UTF-8 in error messages |
Date: |
Tue, 11 Dec 2018 19:03:28 +0100 |
From: Eric Blake <address@hidden>
While most developers are now using UTF-8 environments, it's
harder to guarantee that error messages will be output to
a multibyte locale. Rather than risking error messages that
get corrupted into mojibake when the user runs qemu in a
non-multibyte locale, let's stick to straight ASCII error
messages, rather than assuming that our use of UTF-8 in source
code string constants will work unchanged in other locales.
Found with:
$ LC_ALL=C git grep -l $'".*[\x80-\xff].*"' origin -- '**/*.[ch]' | cat
origin:hw/misc/tmp105.c
origin:hw/misc/tmp421.c
Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[lv: added command line to find non ASCII characters]
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/misc/tmp105.c | 2 +-
hw/misc/tmp421.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index 0918f3a6ea..f6d7163273 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -79,7 +79,7 @@ static void tmp105_set_temperature(Object *obj, Visitor *v,
const char *name,
return;
}
if (temp >= 128000 || temp < -128000) {
- error_setg(errp, "value %" PRId64 ".%03" PRIu64 " °C is out of range",
+ error_setg(errp, "value %" PRId64 ".%03" PRIu64 " C is out of range",
temp / 1000, temp % 1000);
return;
}
diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c
index c234044305..eeb11000f0 100644
--- a/hw/misc/tmp421.c
+++ b/hw/misc/tmp421.c
@@ -153,7 +153,7 @@ static void tmp421_set_temperature(Object *obj, Visitor *v,
const char *name,
}
if (temp >= maxs[ext_range] || temp < mins[ext_range]) {
- error_setg(errp, "value %" PRId64 ".%03" PRIu64 " °C is out of range",
+ error_setg(errp, "value %" PRId64 ".%03" PRIu64 " C is out of range",
temp / 1000, temp % 1000);
return;
}
--
2.19.2
- [Qemu-devel] [PULL 00/30] Trivial patches, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 04/30] hw: set_netdev: remove useless code, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 06/30] misc: Avoid UTF-8 in error messages,
Laurent Vivier <=
- [Qemu-devel] [PULL 07/30] MAINTAINERS: Add missing hw/pci-host entries, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 13/30] MAINTAINERS: Add missing entries for the Jazz machine, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 10/30] MAINTAINERS: Fix ACPI tests data files path, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 03/30] misc: fix spelling, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 09/30] target: hax: replace g_malloc with g_new0, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 11/30] MAINTAINERS: Add a missing entry to the SPARC CPU, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 02/30] virtio: pass argument by value for virtqueue_map_iovec(), Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 18/30] MAINTAINERS: Add missing entries to the vhost section, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 14/30] MAINTAINERS: Add a missing entry for the Xilinx S3A-DSP 1800 machine, Laurent Vivier, 2018/12/11
- [Qemu-devel] [PULL 17/30] MAINTAINERS: Add missing entries to the PC Chipset section, Laurent Vivier, 2018/12/11