Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Set locale to ensure dots are recognized as decimal points in SWC files #442

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adrien-berchet
Copy link
Member

@adrien-berchet adrien-berchet commented Apr 13, 2023

In some cases, the function sscanf does not recognize dots as decimal points because of the locale settings of the user (french in my case, so sscanf expects commas as decimal points). This PR ensures that dots are always considered as decimal points in SWC files, regardless of user locale settings.

@adrien-berchet adrien-berchet requested a review from mgeplf April 13, 2023 08:43
@mgeplf
Copy link
Contributor

mgeplf commented Apr 13, 2023

I'll look at this; I've wanted to remove the sscanf for a while; but I'm not super happy about how iostreams handle locales, either. Plus, I think it was slower.

@adrien-berchet
Copy link
Member Author

Ah ok. As you prefer, this is just a quick fix but we could think about something better.

@adrien-berchet
Copy link
Member Author

Is #460 supposed to replace this PR @mgeplf ?

@mgeplf
Copy link
Contributor

mgeplf commented Jul 4, 2023

Yeah, that's the plan.

@adrien-berchet
Copy link
Member Author

Yeah, that's the plan.

Ok!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants