Command line arguments depend on locale

Ian Malone ibmalone at gmail.com
Thu Jan 31 15:06:48 UTC 2013


On 31 January 2013 15:04, Ian Malone <ibmalone at gmail.com> wrote:
> On 31 January 2013 09:07, Richard W.M. Jones <rjones at redhat.com> wrote:
>> On Thu, Jan 31, 2013 at 12:05:16AM +0100, Benny Amorsen wrote:
>>> This makes it difficult to call system commands. The only workaround is
>>> to set LC_ALL to a known-good locale, but then your users get no benefit
>>> from the translations of error messages and so on.
>>
>> You should *always* set LC_ALL=C when running an external command from
>> another program (and most probably from a shell script too).
>>
>
> I can imagine the problem is general (e.g. programs that need to deal
> with real scalar numbers), but is interpreting IP addresses according
> to locale decimal separators actually correct? The '.' in 127.0.0.1 or
> Ubuntu 10.03 doesn't mean the same thing as in 3/2=1.5.
>

Before anyone else replies... -i to ping is an interval, not an
address. So 0.1s=100ms is potentially translatable. Though I'm not
sure localisation should really trump functionality in quite this way.

-- 
imalone
http://ibmalone.blogspot.co.uk


More information about the devel mailing list