Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aW9Kl-00087Q-3r for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Feb 2016 21:08:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aW9Kk-0000hk-N6 for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Feb 2016 21:08:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aW9K7-0007nL-FU for pgsql-bugs@postgresql.org; Wed, 17 Feb 2016 21:07:47 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aW9K4-0003JU-L4 for pgsql-bugs@postgresql.org; Wed, 17 Feb 2016 21:07:47 +0000 Received: from [IPv6:2001:41d0:fc94:4400:ca0a:a9ff:fe90:47fd] (unknown [IPv6:2001:41d0:fc94:4400:ca0a:a9ff:fe90:47fd]) (Authenticated sender: mlpo@mlpo.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id B9F9A1720BA; Wed, 17 Feb 2016 22:07:41 +0100 (CET) Subject: Re: BUG #13440: unaccent does not remove all diacritics To: Teodor Sigaev , PostgreSQL Bugs References: <20150614063707.2734.30270@wrigleys.postgresql.org> <12238.1434304758@sss.pgh.pa.us> <20150615045056.GM133018@postgresql.org> <38161.1434372933@sss.pgh.pa.us> <1790.1434492074@sss.pgh.pa.us> <4186.1434655846@sss.pgh.pa.us> <56A4426F.2040108@mlpo.fr> <56BCAA91.1040208@sigaev.ru> <56BCF7A5.6020204@mlpo.fr> <56BCF98B.3040302@mlpo.fr> <56BE0BE6.5050003@sigaev.ru> From: =?UTF-8?Q?L=c3=a9onard_Benedetti?= Message-ID: <56C4E11D.5050809@mlpo.fr> Date: Wed, 17 Feb 2016 22:07:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BE0BE6.5050003@sigaev.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 12/02/2016 17:44, Teodor Sigaev wrote : > I'm inclining to commit this patch becouse it suggests more regular > way to update unaccent rules. That is nice. > > But I have some notices: > 1 Is it possible to do not restrict generator script to Python V2? > Python V2, seems, will go away in near future, and it will not be > comfortable to install V2 for a single task. Yes I agree, it makes sense; the script was originally Python 2 but Python 2 is legacy. Moreover, adapting the script for Python 3 seems trivial. > 2 As it's easy to see, nowhere in sources of pgsql there is no a UTF-8 > encoding, just ASCII. I don't see reason to make an exception for this > script. First of all, the majority of pgsql code is C, a language where default encoding is not the same everywhere (may depend on the locale settings or the compiler) so it is logical to use ASCII. On the other hand, UTF-8 encoding for source code is *a feature of Python 3* (to quote the documentation: “The default encoding for Python source code is UTF-8”) so there is no possible ambiguity, and it will not be a problem. That said, some non-ASCII characters may be removed without prejudice from the source code of the script (I think in particular to "“" and "”"). Nevertheless, for some comments, it would be unfortunate (e.g. “# RegEx to parse rules (e.g. “Đ → D ; […]”)” or “# ℃ °C”). > > Thank you. > Thus, I propose to adapt the code to Python 3 (the encoding of the script does not seem to be a problem for the above reasons). I try to do it shortly. Thank you for your feedback. Léonard Benedetti -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs