From: Thomas Huth <thuth@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] misc: Avoid UTF-8 in error messages
Date: Wed, 21 Nov 2018 07:03:44 +0100 [thread overview]
Message-ID: <23455d1b-59fe-d972-a2ab-c53eb1b8a1f9@redhat.com> (raw)
In-Reply-To: <20181120203628.2367003-1-eblake@redhat.com>
On 2018-11-20 21:36, Eric Blake wrote:
> 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.
>
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> 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 0918f3a6ea2..f6d7163273a 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 c234044305d..eeb11000f0f 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;
> }
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2018-11-21 6:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 20:36 [Qemu-devel] [PATCH] misc: Avoid UTF-8 in error messages Eric Blake
2018-11-20 21:28 ` John Snow
2018-11-20 22:01 ` Eric Blake
2018-11-20 22:43 ` John Snow
2018-11-21 11:39 ` Philippe Mathieu-Daudé
2018-11-21 16:20 ` Markus Armbruster
2018-11-21 6:03 ` Thomas Huth [this message]
2018-11-22 12:27 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23455d1b-59fe-d972-a2ab-c53eb1b8a1f9@redhat.com \
--to=thuth@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).