Skip to content

fix(cvar): use locale-independent serialization for double cvars#320

Open
birabittoh wants to merge 1 commit intorexglue:developmentfrom
birabittoh:fix/locale-double-serialization
Open

fix(cvar): use locale-independent serialization for double cvars#320
birabittoh wants to merge 1 commit intorexglue:developmentfrom
birabittoh:fix/locale-double-serialization

Conversation

@birabittoh
Copy link
Copy Markdown
Contributor

std::to_string(double) respects the C locale but can produce comma decimal separators on systems where LC_ALL/LC_NUMERIC is set to a locale like it_IT or de_DE. TOML requires a period, so the written config file would fail to parse on the next launch.

Replace with a std::to_chars-based helper (DoubleToString) which is locale-independent per the C++ standard.

Addresses #318.

std::to_string(double) respects the C locale but can produce comma
decimal separators on systems where LC_ALL/LC_NUMERIC is set to a
locale like it_IT or de_DE. TOML requires a period, so the written
config file would fail to parse on the next launch.

Replace with a std::to_chars-based helper (DoubleToString) which is
locale-independent per the C++ standard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant