Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's locale
authorW. Trevor King <wking@tremily.us>
Tue, 11 Feb 2014 22:33:36 +0000 (14:33 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:54 +0000 (09:59 -0800)
cb/1b044c288abe868c7c382f1224d7e05e128aa4 [new file with mode: 0644]

diff --git a/cb/1b044c288abe868c7c382f1224d7e05e128aa4 b/cb/1b044c288abe868c7c382f1224d7e05e128aa4
new file mode 100644 (file)
index 0000000..e0f7be6
--- /dev/null
@@ -0,0 +1,147 @@
+Return-Path: <wking@tremily.us>\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 177F3431FBF\r
+       for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 14:33:48 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.1\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       RCVD_IN_DNSWL_NONE=-0.0001] 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 2tfjARTBlQSs for <notmuch@notmuchmail.org>;\r
+       Tue, 11 Feb 2014 14:33:40 -0800 (PST)\r
+Received: from qmta13.westchester.pa.mail.comcast.net\r
+       (qmta13.westchester.pa.mail.comcast.net [76.96.59.243])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3652F431FBD\r
+       for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 14:33:40 -0800 (PST)\r
+Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76])\r
+       by qmta13.westchester.pa.mail.comcast.net with comcast\r
+       id R46Y1n0051ei1Bg5DAZfiq; Tue, 11 Feb 2014 22:33:39 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+       by omta24.westchester.pa.mail.comcast.net with comcast\r
+       id RAZd1n00K152l3L3kAZeHB; Tue, 11 Feb 2014 22:33:39 +0000\r
+Received: by odin.tremily.us (Postfix, from userid 1000)\r
+       id F31BC10218BE; Tue, 11 Feb 2014 14:33:36 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;\r
+       t=1392158016; bh=QVRSNDEqVEYyVzbOXaI1V+mCPxFJ9Hy3dUcWxJg9o2Y=;\r
+       h=Date:From:To:Cc:Subject:References:In-Reply-To;\r
+       b=ABfkO+nJ/A9MjLNjfxUYKZ9SJXkS5vSe4FC3cNA+zj1FzVKqStw69ezHaQ0+Of/cj\r
+       C+TZvwQQOikukqCE0a5SNfYOUH4OjLR9EVbL6pwVAvbAyTcQzAy3s6N1l1hJP91EnC\r
+       LOj39z9KhTq4Nq8z8NpkhQ2teRjmDvn7bhUCeX3g=\r
+Date: Tue, 11 Feb 2014 14:33:36 -0800\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's\r
+       locale\r
+Message-ID: <20140211223336.GM14197@odin.tremily.us>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+       <deff072f78f4a7c5b0774e67a8f0517cc704725d.1392056624.git.wking@tremily.us>\r
+       <87eh396e6e.fsf@zancas.localnet>\r
+       <m2sirpu46i.fsf@guru.guru-group.fi>\r
+       <20140211201135.GJ14197@odin.tremily.us>\r
+       <8761ol5mvy.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+       protocol="application/pgp-signature"; boundary="Mt8WfjNhzzoZdE/e"\r
+Content-Disposition: inline\r
+In-Reply-To: <8761ol5mvy.fsf@zancas.localnet>\r
+OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;\r
+       url=http://tremily.us/pubkey.txt\r
+User-Agent: Mutt/1.5.22 (2013-10-16)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+       s=q20121106; t=1392158019;\r
+       bh=lf6LhFtSg4ZvqpuCw9MB5JlFNsPsqUDDW2zEHB87Sf4=;\r
+       h=Received:Received:Received:Date:From:To:Subject:Message-ID:\r
+       MIME-Version:Content-Type;\r
+       b=qTuhkR9GMK0BlDKdBI60lOr57SVkloJexxiWdNdr9SC6zNvu1RIYdS81S087gMQJY\r
+       GuzXQb/AbSzh+MH/dulm8pajAHMrFMJJDLAezCsu7EY0jHquGeRIaZaZEEqjmFD1Ps\r
+       yGtu1/n4DO31cBVCncMJLGTyw6rjgZh5WErYROp+FVfCD/0nolNJQnF7axvO9bGYsj\r
+       EFEqhexTtYpQ2GxxA2fSA+6tF0HIfSeZ8ANe7J80mruLBjpU7Zn2/HjswGBM0RH6Ur\r
+       J4B+0VcPO3lW7bJNR5y3kvvaGqAS22Mz1ddd5MPwgxzT4rmHkBlA5fI2mEF1YCb9IE\r
+       eAkX6edmHbF+g==\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\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 22:33:48 -0000\r
+\r
+\r
+--Mt8WfjNhzzoZdE/e\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Tue, Feb 11, 2014 at 06:02:09PM -0400, David Bremner wrote:\r
+> W. Trevor King writes:\r
+> > If a user has set LANG=3DC, I expect that's what we should use for\r
+> > output (in which case dying with an encoding error is the right\r
+> > thing to do).\r
+>=20\r
+> Perhaps for an interactive tool, intended mainly to be run in a\r
+> terminal.\r
+\r
+I don't understand why your choice of LANG should depend on the\r
+interactive-ness of an invocation.\r
+\r
+> I'm not sure how important the interactive use case is, but I don't\r
+> want to make nmbug-status less robust in order to conform to some\r
+> abstract ideal.\r
+\r
+Changing from a hard-coded version that matches your preferences to a\r
+configurable version that respects LANG may require a bit more care on\r
+the user side (they have to ensure LANG is set in their crontab,\r
+etc.).  However, setting your locale to match your preferences is not\r
+that much work.  For example:\r
+\r
+  export LANG=3Den_US.UTF-8\r
+\r
+and you're done.  The upside of a configurable language is that the\r
+user gets output in their preferred encoding (UTF-8 or not) and=E2=80=94wit=\r
+h a\r
+bit of additional gettext work=E2=80=94in their preferred language.  That\r
+sounds like a fair trade to me.\r
+\r
+Cheers,\r
+Trevor\r
+\r
+--=20\r
+This email may be signed or encrypted with GnuPG (http://www.gnupg.org).\r
+For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\r
+\r
+--Mt8WfjNhzzoZdE/e\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.22 (GNU/Linux)\r
+\r
+iQIcBAEBAgAGBQJS+qTIAAoJEKKfehoaNkbtmvwQAJRC6tIGjtYvFsPL07CwSnH9\r
+BcnxVoFknsRNPDUH114NS40ZhFzAWxpfJHv6G6hPZ8WQQ7lGeEZF/70xF/5CUGF2\r
++RpbBWKjzv38qJ5UErKDhu8KBxtJj5l7L+Ju4blygpS7b5rMxKHVqJ4Ut1chFeAL\r
+rXT/467jGbKAxuctIk5eSpYRXftV2LjIpyn1I/XaWujN8MSyRbXKTdB8QepDZ5Iq\r
+pfRUpogn1R4xi+3W6yVxo5HwzehP+ZBWtHs+7N/9g6RVweCKOiR18YFRk2oDJue6\r
+kMHsh+44isnXTNPK01djdVLA27NPNClbdewKOFSrs9f3TXDzJbSo2/vsfvf3v4o+\r
+s/st7J5cjqlMaMLkJ5DI7io80guFUqJvc0UWixDcIn8l128SNjBD67WA1GIg2LS3\r
+0wA/9afrGepasSVFlx4st5+wZ4FpBctwyvop6+KkrjOO42NG/OZuy2pVYtJOr8Hj\r
+eaZaIU9j4xDhhJr6HIMgvyPaQiVSUsfXAwD3RTALCk1nJsEbloKSEEOBIUQBkORV\r
+m819LFrEKFi7NuL6RMNYC9hYa/MyWLrovUmnfuyvCFmbTF1lqfaUYclzwjpxw5y8\r
+Tny8XjDNyOjH3Y1YcxB0IiPA5nK/ts32IfW+zJ9KcB+ko30gsSP4pK0bRah/Xieb\r
+wSYiolBOJOyoWkpVK1KH\r
+=04Es\r
+-----END PGP SIGNATURE-----\r
+\r
+--Mt8WfjNhzzoZdE/e--\r