From: W. Trevor King Date: Thu, 13 Feb 2014 16:47:22 +0000 (+1600) Subject: [PATCH v3 7/8] nmbug-status: Encode output using the user's locale X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=588c6425e6d9c32af2a937a8d5e433ce1ad3627b;p=notmuch-archives.git [PATCH v3 7/8] nmbug-status: Encode output using the user's locale --- diff --git a/28/8aeef6ecaf796a7ba30904cdff66337cc5daff b/28/8aeef6ecaf796a7ba30904cdff66337cc5daff new file mode 100644 index 000000000..efe1e8413 --- /dev/null +++ b/28/8aeef6ecaf796a7ba30904cdff66337cc5daff @@ -0,0 +1,110 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 17823431FB6 + for ; Thu, 13 Feb 2014 08:51:26 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id JcxIQCH6AATD for ; + Thu, 13 Feb 2014 08:51:19 -0800 (PST) +Received: from qmta14.westchester.pa.mail.comcast.net + (qmta14.westchester.pa.mail.comcast.net [76.96.59.212]) + by olra.theworths.org (Postfix) with ESMTP id 5644F431FAE + for ; Thu, 13 Feb 2014 08:50:59 -0800 (PST) +Received: from omta03.westchester.pa.mail.comcast.net ([76.96.62.27]) + by qmta14.westchester.pa.mail.comcast.net with comcast + id Rof51n00A0bG4ec5EsqzKo; Thu, 13 Feb 2014 16:50:59 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta03.westchester.pa.mail.comcast.net with comcast + id Rson1n002152l3L3PsonQc; Thu, 13 Feb 2014 16:48:59 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id BECAC102DA0C; + Thu, 13 Feb 2014 08:48:46 -0800 (PST) +Received: (nullmailer pid 17995 invoked by uid 1000); + Thu, 13 Feb 2014 16:47:29 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH v3 7/8] nmbug-status: Encode output using the user's locale +Date: Thu, 13 Feb 2014 08:47:22 -0800 +Message-Id: + <1db46f649d156372b6be386ecb04a21badca8009.1392309570.git.wking@tremily.us> +X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1 +In-Reply-To: +References: +In-Reply-To: +References: +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20121106; t=1392310259; + bh=2eEajX6PbKJFyAgIh5Vdl7NjSH56pYNolLBaSyfjiEc=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=BwXhPSk7tsLPf5KkzfPFzVrlBgcxoiL6rceCMYnv/ZzmR+yt4HWDEH1ZGH8jYgkMr + vnCgs/GsG5a8VcHqy+UmkZxbYKUPtI928yEx5a7tmrq/bPEOFMjkNYNgl+vvBybuDe + v3A9z0etziEudOeblQK6IDx2gO9tS2TTCWcsEoGRY2Pluxvbld0KPzDrCn9QTvba0Z + 7OdDfOG0eV4V/RWvfqMKio2BxjaRAd/db1RHyPR2ZXhrqSGlzhhjPG0b2Cz+ATrFVl + k1ms72f2zFXSqQtNcaW7woipAGfEPNJkYt8FylBwxCCOUr1f2sVfkLWDKdt+M5vwnr + 1TvKGyeStJYwg== +Cc: Tomi Ollila +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 13 Feb 2014 16:51:26 -0000 + +Instead of always writing UTF-8, allow the user to configure the +output encoding using their locale. This is useful for previewing +output in the terminal, for poor souls that don't use UTF-8 locales +;). +--- + devel/nmbug/nmbug-status | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +index 9ad7d35..8cc097a 100755 +--- a/devel/nmbug/nmbug-status ++++ b/devel/nmbug/nmbug-status +@@ -90,7 +90,7 @@ class Page (object): + byte_stream = sys.stdout.buffer + except AttributeError: # Python 2 + byte_stream = sys.stdout +- stream = codecs.getwriter(encoding='UTF-8')(stream=byte_stream) ++ stream = codecs.getwriter(encoding=_ENCODING)(stream=byte_stream) + self._write_header(views=views, stream=stream) + for view in views: + self._write_view(database=database, view=view, stream=stream) +@@ -249,7 +249,6 @@ _PAGES['html'] = HtmlPage( + header=''' + + +- + + Notmuch Patches +