From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10983 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: a bug in bindtextdomain() and strip '.UTF-8' Date: Sun, 29 Jan 2017 11:37:14 -0500 Message-ID: <20170129163714.GM1533@brightrain.aerifal.cx> References: <20170129133946.GT17692@port70.net> <20170129140747.GJ1533@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1485707860 26353 195.159.176.226 (29 Jan 2017 16:37:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2017 16:37:40 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-10998-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jan 29 17:37:36 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cXsTk-0005WN-Aw for gllmg-musl@m.gmane.org; Sun, 29 Jan 2017 17:37:24 +0100 Original-Received: (qmail 32573 invoked by uid 550); 29 Jan 2017 16:37:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 32544 invoked from network); 29 Jan 2017 16:37:27 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10983 Archived-At: On Sun, Jan 29, 2017 at 10:48:34PM +0800, He X wrote: > btw, with 'p-> to q->', 'strip .UTF-8'(these two in the first thread), and > these two patches, fcitx, chromium are working well. Can I ask how .UTF-8 got in the locale name to begin with? Did you put it there, or was it copied from another non-glibc system you logged in from, or did chromium itself add it? Re: the original patch, it should probably (depending on what we want to do with other invalid encodings) either use strchr to find the first '.' and strip everything after it, or something like: if (loclen > 6 && !strcmp(locname+loclen-6, ".UTF-8")) There's no reason to pull strstr in here. Rich