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 1gZ839-0002wU-R8 for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Dec 2018 05:36:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ837-00066m-9c for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Dec 2018 05:36:09 +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 1gZ836-00066d-Ry for pgsql-bugs@lists.postgresql.org; Tue, 18 Dec 2018 05:36:09 +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 1gZ834-0001kJ-8x for pgsql-bugs@lists.postgresql.org; Tue, 18 Dec 2018 05:36:07 +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 wBI5a2Gg008507; Tue, 18 Dec 2018 00:36:02 -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: <20181218045708.GI1532@paquier.xyz> References: <23237.1544899488@sss.pgh.pa.us> <29419.1544908811@sss.pgh.pa.us> <31564.1545078667@sss.pgh.pa.us> <20181218045708.GI1532@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 18 Dec 2018 13:57:08 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8505.1545111362.1@sss.pgh.pa.us> Date: Tue, 18 Dec 2018 00:36:02 -0500 Message-ID: <8506.1545111362@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > Could you also add some tests in contrib/unaccent/sql/unaccent.sql at > the same time? That would be nice to check easily the extent of the > patches proposed on this thread. I wonder why unaccent.sql is set up to run its tests in KOI8 client encoding rather than UTF8. It doesn't seem like it's the business of this test script to be verifying transcoding from KOI8 to UTF8 (and if it were meant to do that, it's a pretty incomplete test...). But having it set up like that means that we can't directly add such tests to unaccent.sql, because there are no combining diacritics in the KOI8 character set. We have two unattractive options: * Change client encodings partway through unaccent.sql. I think this would be disastrous for editability of that file; no common tools will understand the encoding change. * Put the new test cases into a separate file with a different client encoding. This is workable, I suppose, but it seems pretty silly when the tests are only a few queries apiece. Another problem I've got with the current setup is that it seems unlikely that many people's editors default to an assumption of KOI8 encoding. Mine guesses that these files are UTF8, and so the test cases look perfectly insane. They do make sense if I transcode the files to UTF8, but I wonder why we're not shipping them as UTF8 in the first place. 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. regards, tom lane