locales and notmuch

David Bremner david at tethera.net
Thu Feb 21 11:11:48 PST 2019

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 at tethera.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 404 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20190221/7b890c78/attachment.c>

More information about the notmuch mailing list