Menu

#74 Conversion with strtod and similar influenced by locale

0.10
closed-fixed
UrJTAG (101)
5
2008-09-17
2008-09-15
No

The functionality of conversion functions like strtod() and others is influenced by the current locale settings.
Detection of the decimal point e.g. can fail when the current locale specifies a different character (as with de_DE where the "decimal point" is actually the comma).
This breaks code that (erroneously) relies on bulk conversion from the anglo-american locale. An example is the SVF player that calculates wrong RUNTEST times.

I found that the environment variable LANG triggers this issue when set to de_DE.UTF-8. An 'unset LANG' resolves the problem.

Discussion

  • Arnim Läuger

    Arnim Läuger - 2008-09-15

    SVF player fixed in r1363, other instances need review.

     
  • Arnim Läuger

    Arnim Läuger - 2008-09-17

    No other occurrences of strtod(), strtof(), strtold(), atof() found in trunk.

     
  • Arnim Läuger

    Arnim Läuger - 2008-09-17
    • assigned_to: nobody --> arniml
    • status: open --> closed-fixed
     
  • Kolja Waschk

    Kolja Waschk - 2017-02-12
    • Group: 0.x --> 0.10
     

Log in to post a comment.