locales and notmuch

Subject: locales and notmuch

Date: Thu, 21 Feb 2019 15:11:48 -0400

To: notmuch@notmuchmail.org


From: David Bremner

So I've been revisiting the "user defined headers" [1] patches. I need
the <prefix> in

    $ notmuch config set index.header.<prefix> "blah"

to be unique case-insensitively, so I decided to convert them to lower
case on input. This turns out to be "fun", if we try to handle things
other than ASCII.  So one option is to just insist prefixes are ASCII.

Otherwise we could insist they are UTF-8, ignoring the locale. The
fullest generality (I think) is to first convert from the users locale
to utf8, as in the attached sample program. The gotcha is that the call
to setlocale is necessary, and can't really be local to string utility
function. So we'd have to add that to notmuch startup. We mostly ignore
locales, so I guess there shouldn't be too much side effects; otoh I
don't have much experience with locales.

So what do people think? ASCII? UTF-8? Locale sensitivitie?

[1] id:20181117140901.1870-1-david@tethera.net

notmuch mailing list