On Fri, Jan 25, 2019 at 12:29:55PM +0700, Robert Elz wrote: > Date: Thu, 24 Jan 2019 16:18:49 +0100 > From: Joerg Sonnenberger <jo...@bec.de> > Message-ID: <20190124151849.ga10...@britannica.bec.de> > > | This is overcomplicated and fragile, IMO. > > ps: if the fragility referred to is that it might now > switch mid-stream into sending messages in English > rather than in the locale's language - then that is > a valid concern, and I could certainly change it > to use strtod_l() in that case to avoid that problem.
No, the fragile refers to the problem that many locales use both "." and "," in numbers. While the standards decided in their infinite wisdom that grouping characters shouldn't be parsed in floating point context, it is very confusing at least for casual users. "sleep 1.000" would be perfectly sensible for a German user, but certainly not do what is expected. Arguing about locale behavior based on OpenBSD doesn't work, since they intentionally doesn't implement most of it anyway. Let's take a step back from the implementation details. I consider the command line interface of a program part of the shell language universe. Programming languages shouldn't change arbitrary based on locale settings. Otherwise you get the VBA madness. That's very different from the data being processed or messages used for interacting with the user. Valery mentioned the Postscript example already. Joerg