Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's locale
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 11 Feb 2014 14:14:45 +0000 (16:14 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:54 +0000 (09:59 -0800)
ab/8c303525f557f975b1ed9c7fdc53a3b9474b18 [new file with mode: 0644]

diff --git a/ab/8c303525f557f975b1ed9c7fdc53a3b9474b18 b/ab/8c303525f557f975b1ed9c7fdc53a3b9474b18
new file mode 100644 (file)
index 0000000..e28e187
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id BDF44431FC0\r
+       for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 06:14:57 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id e1dJWmdliq9i for <notmuch@notmuchmail.org>;\r
+       Tue, 11 Feb 2014 06:14:51 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id A06BC431FBD\r
+       for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 06:14:51 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 718A21000FA;\r
+       Tue, 11 Feb 2014 16:14:45 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>, "W. Trevor King" <wking@tremily.us>,\r
+       notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's\r
+       locale\r
+In-Reply-To: <87eh396e6e.fsf@zancas.localnet>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+       <deff072f78f4a7c5b0774e67a8f0517cc704725d.1392056624.git.wking@tremily.us>\r
+       <87eh396e6e.fsf@zancas.localnet>\r
+User-Agent: Notmuch/0.17+69~g761b031 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 11 Feb 2014 16:14:45 +0200\r
+Message-ID: <m2sirpu46i.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 11 Feb 2014 14:14:57 -0000\r
+\r
+On Tue, Feb 11 2014, David Bremner <david@tethera.net> wrote:\r
+\r
+> "W. Trevor King" <wking@tremily.us> writes:\r
+>\r
+>> Instead of always writing UTF-8, allow the user to configure the\r
+>> output encoding using their locale.  This is useful for previewing\r
+>> output in the terminal, for poor souls that don't use UTF-8 locales\r
+>> ;).\r
+>\r
+> This (or some other patch in the series) seems to cause some problems on\r
+> the production instance:\r
+>\r
+> remote: Traceback (most recent call last):\r
+> remote:   File "/home/nmbug/tools/nmbug-status", line 336, in <module>\r
+> remote:     page.write(database=db, views=config['views'])\r
+> remote:   File "/home/nmbug/tools/nmbug-status", line 96, in write\r
+> remote:     self._write_view(database=database, view=view, stream=stream)\r
+> remote:   File "/home/nmbug/tools/nmbug-status", line 115, in _write_view\r
+> remote:     self._write_threads(threads=threads, stream=stream)\r
+> remote:   File "/home/nmbug/tools/nmbug-status", line 219, in _write_threads\r
+> remote:     ).format(**message_display_data))\r
+> remote:   File "/usr/lib/python2.6/codecs.py", line 351, in write\r
+> remote:     data, consumed = self.encode(object, self.errors)\r
+> remote: UnicodeEncodeError: 'ascii' codec can't encode character u'\u017b' in position 219: ordinal not in range(128)\r
+>\r
+> possibly because of\r
+>\r
+> LANG=C\r
+> LANGUAGE=\r
+> LC_CTYPE="C"\r
+> LC_NUMERIC="C"\r
+> LC_TIME="C"\r
+> LC_COLLATE="C"\r
+> LC_MONETARY="C"\r
+> LC_MESSAGES="C"\r
+> LC_PAPER="C"\r
+> LC_NAME="C"\r
+> LC_ADDRESS="C"\r
+> LC_TELEPHONE="C"\r
+> LC_MEASUREMENT="C"\r
+> LC_IDENTIFICATION="C"\r
+> LC_ALL=C\r
+>\r
+> I think it's fine to _allow_ the user to configure the output encoding. I'm\r
+> less sure about _requiring_ it.\r
+\r
+That reminded me that yesterday (after review, of course) I thought that \r
+we probably want configuration file to be parsed as utf-8 instead of\r
+any encoding user may have in their system...\r
+\r
+> d\r
+\r
+Tomi\r