rustyrussell / ccan

The C Code Archive Network
http://ccodearchive.net/
1.09k stars 206 forks source link

JSON library doesn't work with locales that use comma as decimal separator #78

Open danpla opened 5 years ago

danpla commented 5 years ago

ccan/json library uses locale-dependent C routines (strtod() and sprintf()) to deal with numbers. If the program uses a locale with a comma as a decimal separator, the library will truncate numbers on reading (strtod() will ignore . and everything after it) and create broken JSONs (numbers will have , as separator instead of . as required by the standard).