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: Aharon Robbins
Subject: Re: GNU Awk 3.1.0 problem with float numbers with non-US locale
Date: Wed, 11 Sep 2002 14:34:01 +0300

Let's just say that I'd prefer to ignore the standard for now, and
have things work like A, K, and W intended them to.

I'm open to suggested patches, but I have no desire to try to fix
this myself right now, nor am I convinced that making gawk actually
follow the standard in this area is really A Good Idea.

Arnold

> Date: Tue, 10 Sep 2002 10:18:07 -0700 (PDT)
> From: Paul Eggert <address@hidden>
> To: address@hidden
> CC: address@hidden, address@hidden
> Subject: Re: GNU Awk 3.1.0 problem with float numbers with non-US locale
>
> > 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]