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 1hQuCp-0005Ek-VU for pgsql-bugs@arkaria.postgresql.org; Wed, 15 May 2019 13:44:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQuCo-0007FE-JR for pgsql-bugs@arkaria.postgresql.org; Wed, 15 May 2019 13:44:26 +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 1hQuCo-0007BL-8X for pgsql-bugs@lists.postgresql.org; Wed, 15 May 2019 13:44:26 +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 1hQuCl-00053b-P7 for pgsql-bugs@lists.postgresql.org; Wed, 15 May 2019 13:44:25 +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 x4FDiKCe031391; Wed, 15 May 2019 09:44:20 -0400 From: Tom Lane To: Alvaro Herrera cc: Daniel Gustafsson , iksss.88@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #15805: Problem with =?utf-8?Q?low?= =?utf-8?Q?er_function_for_greek_sigma_=28=CE=A3=29?= letter In-reply-to: <20190515122048.GA12876@alvherre.pgsql> References: <20190515122048.GA12876@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 15 May 2019 08:20:48 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <31389.1557927860.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 15 May 2019 09:44:20 -0400 Message-ID: <31390.1557927860@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-May-15, Daniel Gustafsson wrote: >> This is indeed a bug, and a rare occurrence since AFAICT from ISO 30112= and >> googling there is only a single case of word-final lowercasing which is= this >> sigma. The attached patch takes a stab at fixing this. > Ummm ... isn't this a counterexample? > https://hebrew4christians.com/Grammar/Unit_One/Final_Forms/final_forms.h= tml I do not think the patch as given is acceptable in any case: 1. assumes without any evidence whatsoever that the system's wide-characte= r representation is Unicode code points; 2. assumes without checking that the locale is one that would allow this conversion (counterexample: C locale); 3. unreasonable hard-coded assumption about what the "not a word character= " condition is. It's possible that 1 and 2 could be finessed by checking both that the original character is =CE=A3 and the new one is =CF=83 (in Unicode). We'd= still theoretically be taking a risk of the wrong substitution if the wchar representation is not Unicode, but the odds seem fairly small. As for point 3, why aren't you using iswalpha() on the next character? regards, tom lane