Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2014 08:26:48 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Phil Shafer <phil@juniper.net>
Cc:        arch@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, marcel@freebsd.org, John-Mark Gurney <jmg@funkthat.com>, "Simon J. Gerraty" <sjg@juniper.net>
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <20140814052648.GM2737@kib.kiev.ua>
In-Reply-To: <201408131936.s7DJaA1r089174@idle.juniper.net>
References:  <201408131936.s7DJaA1r089174@idle.juniper.net>

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

--iUV/lbBrmPtUT9dM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 13, 2014 at 03:36:10PM -0400, Phil Shafer wrote:
> Phil Shafer writes:
> >FWIW, the UTF-8 strategy for libox is this:
> >- all format strings are UTF-8
> >- argument strings (%s) are UTF-8
> >- "%ls" handles wide characters
> >- "%hs" will handle locale-based strings
> >- XML, JSON, and HTML will be UTF-8 output
> >- text will be locale-based
>=20
> Sorry for the delay, but this code is now done.  Formatting widths
> are done using wcwidth() so things like "%15.15s" work correctly
> regardless of locale settings.  As a background task, I'm converting
> some basic commands to use libxo.  It's slow work, but needs done....
>=20
> I've a related topic:  when an app goes to run a child command, how
> can it determine whether that binary supports libxo-based encoding
> requests?  This should be known before the binary is run, since
> there's no means of auto-detecting the supported output after the
> fact.
>=20
> For example, say I want to make a JSON-based API for my server.  I
> can setenv("LIBXO_OPTIONS", "json") to get JSON output, but I won't
> know if the binary supports this or if the output needs to be wrapped
> and escaped.
>=20
> I know ELF "Note" elements can be used to carry vendor-specific
> data, but have no experience with them.  Would it be reasonable to
> use them as a means of communicating this information to other bits
> of software?
No.

> Is FreeBSD using Notes for other information currently?
Yes, the notes are used to communicate the information required by
the dynamic linker to correctly activate the image. The mechanism has
nothing to do with application-specific features, and overloading it for
that purpose is severe and pointless layering violation. Things should
not be done just because they could be done.

Using the static tagging for the dynamic application properties is wrong
anyway.  E.g., would you consider the mere fact that the binary is linked
against your library, as the indication that your feature is supported ?
If not, how does it differ from the presence of some additional note ?

--iUV/lbBrmPtUT9dM
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJT7EiXAAoJEJDCuSvBvK1BOKoP/1zGvwB4g3dkL+/oLInckVPD
NEeNWyXgExYOCMkA9yNMhqagxT7t42VbvyacElOQb/kGdZImbKsxuqbdr+pWEOng
nYb4EGG+ORS/21jkcEE84WwQrZzwNsnavr2NUJPQd4NML19Y+zKGwIpLK+oguYKM
sILBXLxVmmI2Z/ef8O7J8l69MsaP+llPo5lOgcFE6D/DsAjSNQyRSFAMDODB3V7+
na1rGqNSvQNfNR5w3YQUYtSo/htDKy4hkZphayQTP68EFE8gM5lv7pqIV3GABvq1
dIjDDhzTAtlsi2U5Z4cL/RV+bWHYwKYatHAgJKFiuMx+MkOw/GLXOTVO0kZcQyV4
OGVVEZ+xURnKNaHYaozy520EoYlCz4rkOGvP8O9yiB0qdhjXDF1RJptlGByx30K0
4fRA7vKG61Aks92XR+jezhu0AcLXcKnighgi46L+/HfEYM63Tqoyvm6MkE1JVMb4
idkKxO4dH/91CXv/CeNYpSeZLtfXtaT6Y2oknlh5+uJlVOYS2Dg/ambwcyDqowjb
qGHGy6PQz9kdEAbTj16LYTWpPNlpNXHy7r6n7P4ufIB0lsnVFw6mrJ5XGmzoRe3D
SmxSS0eg4oMsOargh/W5DxkyRg5Wk3cCFZU8j4g7kpvmN6sIqShP8Gcp6/qqUKEd
lXhD6rit2OI265CDBbGY
=2x00
-----END PGP SIGNATURE-----

--iUV/lbBrmPtUT9dM--



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