pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Léonard Benedetti <benedetti@mlpo.fr>
To: Teodor Sigaev <teodor@sigaev.ru>
To: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13440: unaccent does not remove all diacritics
Date: Wed, 17 Feb 2016 22:07:41 +0100
Message-ID: <56C4E11D.5050809@mlpo.fr> (raw)
In-Reply-To: <56BE0BE6.5050003@sigaev.ru>
References: <20150614063707.2734.30270@wrigleys.postgresql.org>
	<12238.1434304758@sss.pgh.pa.us>
	<CAEP8ZNWBH7Lc8KeaAxbPFJAC-RUUCKfBv5xcfOjqKvf4309Esw@mail.gmail.com>
	<20150615045056.GM133018@postgresql.org>
	<38161.1434372933@sss.pgh.pa.us>
	<CAEepm=0YVseDdN3Odjg2AZ2QvEPshqwJf=4zZbea5cwMQEP1Bw@mail.gmail.com>
	<CAEepm=2XAMTA8r3V682_aNZOz1kB3MdMvymDQmO7TA0qg99GAA@mail.gmail.com>
	<1790.1434492074@sss.pgh.pa.us>
	<CAEepm=2yw0so0ke8ZRy-qWOCrPRC2Ts0cs_6O2Zudkg=R+sR9Q@mail.gmail.com>
	<4186.1434655846@sss.pgh.pa.us>
	<CAEepm=24OUabfGQM4JLnNCtwu_fvhuH34ObKTbnsEj5oKLWL8w@mail.gmail.com>
	<56A4426F.2040108@mlpo.fr>
	<CAEepm=3Th+3XRiOoXewLvL1DybCbKxjc0FE4o6XqaZZBLUSOvg@mail.gmail.com>
	<56BCAA91.1040208@sigaev.ru>
	<56BCF7A5.6020204@mlpo.fr>
	<56BCF98B.3040302@mlpo.fr>
	<56BE0BE6.5050003@sigaev.ru>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (64+ messages)  latest in thread

Message-ID: <56C4E11D.5050809@mlpo.fr>
Permalink:  ../56C4E11D.5050809@mlpo.fr/
Also on:    postgresql.org/message-id/56C4E11D.5050809@mlpo.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: benedetti@mlpo.fr, teodor@sigaev.ru
  Subject: Re: BUG #13440: unaccent does not remove all diacritics
  In-Reply-To: <56C4E11D.5050809@mlpo.fr>
  References: <20150614063707.2734.30270@wrigleys.postgresql.org> <12238.1434304758@sss.pgh.pa.us> <CAEP8ZNWBH7Lc8KeaAxbPFJAC-RUUCKfBv5xcfOjqKvf4309Esw@mail.gmail.com> <20150615045056.GM133018@postgresql.org> <38161.1434372933@sss.pgh.pa.us> <CAEepm=0YVseDdN3Odjg2AZ2QvEPshqwJf=4zZbea5cwMQEP1Bw@mail.gmail.com> <CAEepm=2XAMTA8r3V682_aNZOz1kB3MdMvymDQmO7TA0qg99GAA@mail.gmail.com> <1790.1434492074@sss.pgh.pa.us> <CAEepm=2yw0so0ke8ZRy-qWOCrPRC2Ts0cs_6O2Zudkg=R+sR9Q@mail.gmail.com> <4186.1434655846@sss.pgh.pa.us> <CAEepm=24OUabfGQM4JLnNCtwu_fvhuH34ObKTbnsEj5oKLWL8w@mail.gmail.com> <56A4426F.2040108@mlpo.fr> <CAEepm=3Th+3XRiOoXewLvL1DybCbKxjc0FE4o6XqaZZBLUSOvg@mail.gmail.com> <56BCAA91.1040208@sigaev.ru> <56BCF7A5.6020204@mlpo.fr> <56BCF98B.3040302@mlpo.fr> <56BE0BE6.5050003@sigaev.ru> <56C4E11D.5050809@mlpo.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox