Mail Archives: geda-user/2015/08/29/12:24:04
--HB7frlJYaPDRK8vk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sat, Aug 29, 2015 at 02:32:07PM +0200, Markus Hitter (mah AT jump-ing DOT de) [=
via geda-user AT delorie DOT com] wrote:
> Folks,
>=20
> it was a long standing issue that NLS support of pcb was kind of broken. =
It was handled by environment variables like LC_ALL or LC_NUMERIC to values=
of best guess and relying on this.
>=20
> To the non-involved: well known functions like printf() and fprintf() cha=
nge behaviour depending on these variables. They don't always put a '.' as =
decimal separator, but the one the national language expects. Accordingly, =
using such functions to write to files leads to different file contents, of=
ten making them unusable for the tools they're intended for. Making printf(=
) & co. dependant on environment variables is a broken concept, still pcb h=
appened to use it a lot. An issue almost invisible on english locales, afte=
r all.
>=20
> After some back and forth a bunch of functions replacing printf() were wr=
itten which can (depending on modifiers) write in "file mode", i.e. with al=
ways a '.' as decimal separator. That's pcb_printf(), pcb_fprintf() and pcb=
_snprintf(), the modifier is a back-apostrophe (`). Not all my work, these =
functions were there before, just without this generic file mode.
>=20
> All tests in the testsuite pass now, independently on wether pcb is built=
with NLS or not, and also independently from the users current locale. I t=
hink this is the first time pcb achieved such a state.
>
Thanks a lot for this, and for your other improvements to pcb-printf!
--=20
Andrew Poelstra
Mathematics Department, University of Texas at Austin
Email: apoelstra at wpsoftware.net
Web: https://www.wpsoftware.net/andrew
"When I came into my land, I did not understand:
neither dry rot, nor the burn pile, nor the bark-beetle,
nor the dry well, nor the black bear."
-- Joanna Newsom
--HB7frlJYaPDRK8vk
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJV4dxsAAoJEMWI1jzkG5fBqDoH/2TNqQNhiCLyfdvxAqNq4ww1
FHJtQmVh26L5gTxnWg1Tr2yjWjPqAZDxwdh63DItbX8LGkoYRdZnt/Tsj6SRsHYh
Ho2KsrHgZDJGcgR3AFdCOYHeGWGAoPRmN4tZ2TuB5FhwN14LFvjwrZWxr+qF0tC/
xV061Uqd/7yNUl0h9J8k11z9IwnSXDd7fBBZJ7Z5APhrpB3tRXdFIGUz+EZXUR2c
ghaQJKjoSL4EodOWAI3XRAlqaGoUabZSiokfp3+9/3WaTPQBpaWfN8Nf5D9Rng7D
4shGtnbug3RFTXW8WemxqomiTGX42bYG89OF1VVYQg3ebZAE8n4C+NuvSrwcR6U=
=rhRQ
-----END PGP SIGNATURE-----
--HB7frlJYaPDRK8vk--
- Raw text -