notmuch/devel
W. Trevor King 320d4a856e nmbug-status: Hardcode UTF-8 instead of using the user's locale
David [1] and Tomi [2] both feel that the user's choice of LANG is not
explicit enough to have such a strong effect on nmbug-status.  For
example, cron jobs usually default to LANG=C, and that is going to
give you ASCII output:

  $ LANG=C python -c 'import locale; print(locale.getpreferredencoding())'
  ANSI_X3.4-1968

Trying to print Unicode author names (and other strings) in that
encoding would crash nmbug-status with a UnicodeEncodeError.  To avoid
that, this patch hardcodes UTF-8, which can handle generic Unicode,
and is the preferred encoding (regardless of LANG settings) for
everyone who has chimed in on the list so far.  I'd prefer trusting
LANG, but in the absence of any users that prefer non-UTF-8 encodings
I'm fine with this approach.

While we could achieve the same effect on the output content by
dropping the previous patch (nmbug-status: Encode output using the
user's locale), Tomi also wanted UTF-8 hardcoded as the config-file
encoding [2].  Keeping the output encoding patch and then adding this
to hardcode both the config-file and output encodings at once seems
the easiest route, now that fd29d3f (nmbug-status: Decode Popen output
using the user's locale, 2014-02-10) has landed in master.

[1]: id="877g8z4v4x.fsf@zancas.localnet"
     http://article.gmane.org/gmane.mail.notmuch.general/17202
[2]: id="m2vbwj79lu.fsf@guru.guru-group.fi"
     http://article.gmane.org/gmane.mail.notmuch.general/17209
2014-02-14 21:45:07 -04:00
..
nmbug nmbug-status: Hardcode UTF-8 instead of using the user's locale 2014-02-14 21:45:07 -04:00
doxygen.cfg devel: add doxygen configuration file 2014-01-05 08:59:52 -04:00
man-to-mdwn.pl devel: add post-release tools news2wiki.pl and man-to-mdwn.pl 2013-03-29 09:23:19 -04:00
news2wiki.pl devel: add post-release tools news2wiki.pl and man-to-mdwn.pl 2013-03-29 09:23:19 -04:00
printmimestructure devel: add dkg's printmimestructure script to notmuch devel scripts 2013-05-23 08:01:37 -03:00
release-checks.sh devel/release-checks.sh: adjust to LIBNOTMUCH version checks 2013-12-30 20:39:25 -04:00
RELEASING Start devel directory for developer tools and documentation. 2012-01-17 22:53:31 -04:00
schemata search: Add stable queries to thread search results 2013-11-08 20:43:29 -04:00
STYLE devel/STYLE: information how to enable standard pre-commit hook 2013-03-29 09:21:44 -04:00
TODO emacs: Fix search tagging races 2013-11-08 20:52:00 -04:00
uncrustify.cfg uncrustify.cfg: added 3 new types for uncrustify to know 2012-11-07 08:00:03 -04:00