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

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

Date: Tue, 11 Feb 2014 14:33:36 -0800

To: David Bremner

Cc: Tomi Ollila, notmuch@notmuchmail.org

From: W. Trevor King


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
signature.asc (application/pgp-signature)

Thread: