Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2014 13:47:50 +0100
From:      Michael Gmelin <grembo@freebsd.org>
To:        Tijl Coosemans <tijl@FreeBSD.org>
Cc:        =?UTF-8?B?R8OhYm9yIEvDtnZlc2TDoW4=?= <gabor@kovesdan.org>, svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, Andrey Chernov <ache@freebsd.org>, ports-committers@freebsd.org
Subject:   Re: svn commit: r341775 - in head: Mk/Uses converters/libiconv devel/gettext
Message-ID:  <20140130134750.645223a2@bsd64.grem.de>
In-Reply-To: <20140130132652.5d945d44@kalimero.tijl.coosemans.org>
References:  <201401292024.s0TKOomF031237@svn.freebsd.org> <52E97640.5020703@freebsd.org> <52EA297E.6030607@kovesdan.org> <20140130132652.5d945d44@kalimero.tijl.coosemans.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, 30 Jan 2014 13:26:52 +0100
Tijl Coosemans <tijl@FreeBSD.org> wrote:

> On Thu, 30 Jan 2014 11:29:18 +0100 G=C3=A1bor K=C3=B6vesd=C3=A1n wrote:
> > On 2014.01.29. 22:44, Andrey Chernov wrote:
> >> On 30.01.2014 0:24, Tijl Coosemans wrote:
> >>>>   - Add two new arguments to USES=3Diconv so ports can indicate
> >>>> they use GNU iconv extensions that the base system iconv doesn't
> >>>> support yet:
> >>>>     * wchar_t: port uses the special WCHAR_T character
> >>>> conversion.
> >>>>     * translit: port uses //TRANSLIT or //IGNORE conversion
> >>>> options. Adding one or both of these arguments makes the port
> >>>> depend on converters/libiconv for now.
> >>>>   - Allow installation of converters/libiconv on FreeBSD 10+.
> >> Delete-restore loop.
> >> What people smoke, replacing gnu iconv with system one without even
> >> implementing //TRANSLIT and //IGNORE first?
> >> At this stage looks more logical to implement them in the system
> >> iconv, rather than to return gnu one back.
>=20
> That's not an option for users on 10.0 release.
>=20
> > In fact, system iconv uses //TRANSLIT by default. What it does not=20
> > implement is the lack of //TRANSLIT. This is conformant to POSIX.
>=20
> I see.  I don't think we have to implement the lack of //TRANSLIT.
> What we do need are //IGNORE and WCHAR_T.  Also, the transliteration
> is different.  The example code I was given prints the unicode
> character "=C5=BD":
>=20
> # cat test.php
> <?php
> print iconv("UTF-8", "ISO-8859-1//TRANSLIT", "\xc5\xbd");
> ?>
> # php test.php
> Z
>=20
> With system iconv this prints "?" and with libiconv "Z".

"?" is not a useful transliteration for real world applications (e.g.
convert a name, so it can be printed in US-ASCII - required by many
legacy systems like credit card networks). It's obviously much easier to
implement "transliterate everything to ?", but almost certainly not what
people using //TRANSLIT expect to happen. FreeBSD had been using GNU
iconv forever and so far I haven't seen anything in 10.0-RELEASE
ports/UPDATING, release ERRATA etc. that would keep people from
silently breaking applications on update. In my opinion that would be
the bare minimum measure when doing such a change.

PHP Example (before the patch to use GNU iconv, thanks again for your
work):

<?php

print preg_replace("/[^a-zA-Z ]/", "",
  iconv("ISO8859-1", "US-ASCII//TRANSLIT", "G=C3=A1bor K=C3=B6vesd=C3=A1n")=
);

?>

With gnu iconv:
# php t.php
Gabor Kovesdan

With system iconv:
# php t.php
Gbor Kvesdn

--=20
Michael Gmelin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140130134750.645223a2>