From nobody Mon Apr 29 05:05:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154274629017280.02700893024655; Tue, 20 Nov 2018 12:38:10 -0800 (PST) Received: from localhost ([::1]:35793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPCme-0003Jc-GH for importer@patchew.org; Tue, 20 Nov 2018 15:38:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPClG-0002b8-6w for qemu-devel@nongnu.org; Tue, 20 Nov 2018 15:36:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPClB-0005M3-He for qemu-devel@nongnu.org; Tue, 20 Nov 2018 15:36:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55392) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPCl8-0005FM-IX; Tue, 20 Nov 2018 15:36:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E94DD308426A; Tue, 20 Nov 2018 20:36:32 +0000 (UTC) Received: from red.redhat.com (ovpn-121-142.rdu2.redhat.com [10.10.121.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51EE484ED; Tue, 20 Nov 2018 20:36:32 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 20 Nov 2018 14:36:28 -0600 Message-Id: <20181120203628.2367003-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Nov 2018 20:36:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] misc: Avoid UTF-8 in error messages X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- 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 >=3D 128000 || temp < -128000) { - error_setg(errp, "value %" PRId64 ".%03" PRIu64 " =C2=B0C is out o= f range", + error_setg(errp, "value %" PRId64 ".%03" PRIu64 " C is out of rang= e", 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 >=3D maxs[ext_range] || temp < mins[ext_range]) { - error_setg(errp, "value %" PRId64 ".%03" PRIu64 " =C2=B0C is out o= f range", + error_setg(errp, "value %" PRId64 ".%03" PRIu64 " C is out of rang= e", temp / 1000, temp % 1000); return; } --=20 2.17.2