From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CA1D16DE109F for ; Thu, 21 Feb 2019 11:57:39 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.008 X-Spam-Level: X-Spam-Status: No, score=-0.008 tagged_above=-999 required=5 tests=[AWL=-0.007, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JeYyLMbPRlFr for ; Thu, 21 Feb 2019 11:57:39 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id E4CE56DE1077 for ; Thu, 21 Feb 2019 11:57:38 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1gwuTS-0001ei-0k for notmuch@notmuchmail.org; Thu, 21 Feb 2019 14:57:38 -0500 Received: (nullmailer pid 7441 invoked by uid 1000); Thu, 21 Feb 2019 19:57:36 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: locales and notmuch In-Reply-To: <8736ohard7.fsf@tethera.net> References: <8736ohard7.fsf@tethera.net> Date: Thu, 21 Feb 2019 15:57:36 -0400 Message-ID: <87r2c0ap8v.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 19:57:39 -0000 David Bremner writes: > 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. > 1) It might be possible to save and restore the locale, although that sounds a bit heavy weight for lowercasing a string. 2) We'd need a UTF-8 locale to test in. I guess C.UTF-8 is not yet universally available. d