bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Awk 3.1.0 problem with float numbers with non-US locale


From: Paul Eggert
Subject: Re: GNU Awk 3.1.0 problem with float numbers with non-US locale
Date: Tue, 10 Sep 2002 10:18:07 -0700 (PDT)

> From: Aharon Robbins <address@hidden>
> Date: Wed, 21 Aug 2002 14:16:56 +0300
> 
> I suggest trying the following patch to see if this fixes the problem.

That patch is not correct, as POSIX 1003.1-2001 requires that awk must
use the radix character of the current locale when interpreting
numeric input, performing conversions between numeric and string
values, and formatting numeric output.  So gawk 3.1.1's behavior is
correct in this area.

There may be some bugs in this area, because POSIX says that in a few
contexts the locale is ignored and "." is the decimal-point character
regardless of locale.  These contexts are awk programs themselves, and
assignments in command-line arguments.  Gawk probably doesn't handle
this part of the standard correctly; the fix (I think) is to
temporarily setlocale(LC_NUMERIC, "C") while parsing awk programs and
command-line arguments, but setlocale(LC_NUMERIC, "") at all other
times.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]