Bug 24855 - Localization should not be done by fprintf()
Localization should not be done by fprintf()
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-24 11:01 EST by Enrico Scholz
Modified: 2016-11-24 10:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-24 11:01:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2001-01-24 11:01:17 EST
The follwing program gives different output in different languages:

------ fp.c --------
#include <stdio.h>
#include <locale.h>

int main()
{
        setlocale (LC_ALL, "");
        printf("%f\n", 42.0);
}
-----------------

$ gcc -std=c99 ~/tmp/fp.c
$ LANG=C ./a.out 
42.000000
$ LANG=de_DE ./a.out 
42,000000


The C99-draft says at 7.19.6.1/#8:

-------------------
f,F     A  double argument representing a (finite) floating-
               point number is converted to decimal notation in the
               style  [-]ddd.ddd,
-------------------

so the latter output (with a comma instead of a period)  is wrong.

This behavior breaks a lot of programs (e.g. doxygen generates TeX with
measure-units like 1,6666cm)
Comment 1 Enrico Scholz 2001-01-24 11:24:55 EST
Sorry, behavior if glibc is correct (I have missed 7.1.1/#); the other programs
are wrong so I have to write a lot of other bugreports.

Note You need to log in before you can comment on or make changes to this bug.