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