Skip to content

Add tests for number parsing with locales that use comma for decimal separator #112

@danpla

Description

@danpla

Some JOSN libraries (like the current ccan/json) use locale-dependent C routines like strtod() and snprintf() for reading and writing numbers. In a program that sets a C locale with a comma as the decimal separator (like Russian ru_RU.UTF-8) this will lead to implicit truncation of numbers (strtod() will ignore . and everything after it) and writing broken JSONs (because the numbers in the file will have commas instead of periods).

It would be nice to know which libraries fail to read and write numbers with a locale that use a comma as the decimal separator. If a library doesn't pass this test, others don't actually matter, because the library is useless in practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions