Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fziae-0007ny-Db for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Sep 2018 13:20:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fziac-0006QG-D8 for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Sep 2018 13:20:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fziac-0006PU-3Q for pgsql-bugs@lists.postgresql.org; Tue, 11 Sep 2018 13:20:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fziaY-0004Je-LN for pgsql-bugs@postgresql.org; Tue, 11 Sep 2018 13:20:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8BDKDrT018166; Tue, 11 Sep 2018 09:20:13 -0400 From: Tom Lane To: Haotian Yang cc: "pgsql-bugs@postgresql.org" Subject: Re: `pg_trgm` not recognizing Chinese characters in macOS In-reply-to: References: Comments: In-reply-to Haotian Yang message dated "Tue, 11 Sep 2018 03:06:06 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18164.1536672013.1@sss.pgh.pa.us> Date: Tue, 11 Sep 2018 09:20:13 -0400 Message-ID: <18165.1536672013@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Haotian Yang writes: > Versions: macOS 10.13.6, PostgreSQL 10.5, pg_trgm 1.3. > LC_ALL=en_US.UTF-8 pg_trgm relies on libc's functions (specifically, iswalpha()) to determine what is a word character or not. Unfortunately, the UTF8 locale support in macOS is pretty incomplete, and I don't find it too surprising that it's not recognizing Chinese characters as alphabetic. Now, you could make a good argument that they *shouldn't* be considered alphabetic in an en_US locale; but I'm unsure whether switching to a more appropriate locale will help. Anyway, I'd first try zh_CN.UTF-8, and if that doesn't fix it, the place to complain is https://bugreport.apple.com/ ... I'm sure they know about it already, but the number of reports has an impact on how fast they fix things. regards, tom lane