From 8d4956da9d55fe8eeb451c97197f9af3c9ed9859 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 12 Feb 2014 08:12:41 +2000 Subject: [PATCH] Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's locale --- a3/836b4afc673654be074f917ee4d95284c047cc | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 a3/836b4afc673654be074f917ee4d95284c047cc diff --git a/a3/836b4afc673654be074f917ee4d95284c047cc b/a3/836b4afc673654be074f917ee4d95284c047cc new file mode 100644 index 000000000..7d2f37b10 --- /dev/null +++ b/a3/836b4afc673654be074f917ee4d95284c047cc @@ -0,0 +1,100 @@ +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 1A1D3431FBD + for ; Tue, 11 Feb 2014 04:12:58 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 FAsdNfDbSF83 for ; + Tue, 11 Feb 2014 04:12:50 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A4844431FAF + for ; Tue, 11 Feb 2014 04:12:50 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1WDCCj-0003Lm-MT; Tue, 11 Feb 2014 08:12:45 -0400 +Received: (nullmailer pid 27778 invoked by uid 1000); Tue, 11 Feb 2014 + 12:12:41 -0000 +From: David Bremner +To: "W. Trevor King" , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's + locale +In-Reply-To: + +References: + +User-Agent: Notmuch/0.17+53~g3e1d7f6 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 11 Feb 2014 08:12:41 -0400 +Message-ID: <87eh396e6e.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +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: Tue, 11 Feb 2014 12:12:58 -0000 + +"W. Trevor King" writes: + +> 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 +> ;). + +This (or some other patch in the series) seems to cause some problems on +the production instance: + +remote: Traceback (most recent call last): +remote: File "/home/nmbug/tools/nmbug-status", line 336, in +remote: page.write(database=db, views=config['views']) +remote: File "/home/nmbug/tools/nmbug-status", line 96, in write +remote: self._write_view(database=database, view=view, stream=stream) +remote: File "/home/nmbug/tools/nmbug-status", line 115, in _write_view +remote: self._write_threads(threads=threads, stream=stream) +remote: File "/home/nmbug/tools/nmbug-status", line 219, in _write_threads +remote: ).format(**message_display_data)) +remote: File "/usr/lib/python2.6/codecs.py", line 351, in write +remote: data, consumed = self.encode(object, self.errors) +remote: UnicodeEncodeError: 'ascii' codec can't encode character u'\u017b' in position 219: ordinal not in range(128) + +possibly because of + +LANG=C +LANGUAGE= +LC_CTYPE="C" +LC_NUMERIC="C" +LC_TIME="C" +LC_COLLATE="C" +LC_MONETARY="C" +LC_MESSAGES="C" +LC_PAPER="C" +LC_NAME="C" +LC_ADDRESS="C" +LC_TELEPHONE="C" +LC_MEASUREMENT="C" +LC_IDENTIFICATION="C" +LC_ALL=C + +I think it's fine to _allow_ the user to configure the output encoding. I'm +less sure about _requiring_ it. + +d -- 2.26.2