Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ8nZ-000605-MS for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Dec 2018 06:24:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ8nX-0008AX-SV for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Dec 2018 06:24:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ8nX-0008AQ-Iq for pgsql-bugs@lists.postgresql.org; Tue, 18 Dec 2018 06:24:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ8nQ-0002l8-PF for pgsql-bugs@lists.postgresql.org; Tue, 18 Dec 2018 06:24:06 +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 wBI6Nvpg011346; Tue, 18 Dec 2018 01:23:57 -0500 From: Tom Lane To: Michael Paquier cc: Thomas Munro , hugh@whtc.ca, daniel@manitou-mail.org, PostgreSQL mailing lists Subject: Re: BUG #15548: Unaccent does not remove combining diacritical characters In-reply-to: <20181218060735.GL1532@paquier.xyz> References: <29419.1544908811@sss.pgh.pa.us> <31564.1545078667@sss.pgh.pa.us> <20181218045708.GI1532@paquier.xyz> <8506.1545111362@sss.pgh.pa.us> <20181218060735.GL1532@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 18 Dec 2018 15:07:35 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <11344.1545114237.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 18 Dec 2018 01:23:57 -0500 Message-ID: <11345.1545114237@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Tue, Dec 18, 2018 at 12:36:02AM -0500, Tom Lane wrote: >> tl;dr: I think we should convert unaccent.sql and unaccent.out >> to UTF8 encoding. Then, adding more test cases for this patch >> will be easy. > Do you think that we could also remove the non-ASCII characters from the > tests? It would be easy enough to use E'\xNN' (utf8 hex) or such in > input, and show the output with bytea. I'm not really for that, because it would make the test cases harder to verify by eyeball. With the current setup --- other than the uncommon-outside-Russia encoding choice --- you don't really need to read or speak Russian to see that this: SELECT unaccent('ёлка'); unaccent ---------- елка (1 row) probably represents unaccent doing what it ought to. If everything is in hex then it's a lot harder. Ten years ago I might've agreed with your point, but today it's hard to believe that anyone who takes any interest at all in unaccent's functionality would not have a UTF8-capable terminal. > That's harder to read, still we > discussed about not using UTF-8 in the python script to allow folks with > simple terminals to touch the code the last time this was touched > (5e8d670) and the characters used could be documented as comments in the > tests. Maybe I'm misremembering, but I thought that discussion was about the code files. I am still mistrustful of non-ASCII in our code files. But for data and test files, we've been accepting UTF8 ever since the text-search-in-core stuff landed. Heck, unaccent.rules itself is UTF8. regards, tom lane