[PATCH v2 14/20] nmbug-status: Encode output using the user's locale

W. Trevor King wking at tremily.us
Tue Feb 11 14:33:36 PST 2014


On Tue, Feb 11, 2014 at 06:02:09PM -0400, David Bremner wrote:
> W. Trevor King writes:
> > If a user has set LANG=C, I expect that's what we should use for
> > output (in which case dying with an encoding error is the right
> > thing to do).
> 
> 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=en_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—with a
bit of additional gettext work—in their preferred language.  That
sounds like a fair trade to me.

Cheers,
Trevor

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140211/a882201b/attachment.pgp>


More information about the notmuch mailing list