Skip to content

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Mar 25, 2020

Make our stringstream usage locale independent.

As discussed with laanwj in #18134 (comment). Fixes #18281.

@practicalswift practicalswift force-pushed the cpp-locale branch 3 times, most recently from 64adfe1 to b603652 Compare March 26, 2020 00:40
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 26, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@practicalswift practicalswift force-pushed the cpp-locale branch 2 times, most recently from 2ae47c4 to 0a46909 Compare March 26, 2020 19:07
@practicalswift practicalswift changed the title util: Make current implicit C++ locale assumption in tfm::format(...) explicit util: Make our stringstream usage locale independent. Formalize locale assumptions. Mar 26, 2020
@practicalswift practicalswift changed the title util: Make our stringstream usage locale independent. Formalize locale assumptions. util: Make our stringstream usage locale independent Mar 29, 2020
@practicalswift
Copy link
Contributor Author

@sipa @laanwj Dropped the "util: Make implicit C++ locale assumptions explicit" commit. The current PR looks good? :)

@practicalswift
Copy link
Contributor Author

@MarcoFalke

Would it be possible to add a static std::stringstream ClassicStringStream() { std::stringstream s; s.imbue(); return s; } to our str util library, so that call sites have a lower LOC-overhead?

Added! Please re-review :)

@practicalswift practicalswift force-pushed the cpp-locale branch 2 times, most recently from a512f39 to 57092aa Compare March 29, 2020 15:24
@practicalswift
Copy link
Contributor Author

@MarcoFalke Feedback addressed. Please re-review :)

@practicalswift
Copy link
Contributor Author

@MarcoFalke Would you mind reviewing again? Your feedback has been addressed :)

@practicalswift
Copy link
Contributor Author

Rebased :)

@practicalswift
Copy link
Contributor Author

practicalswift commented Apr 29, 2020

Any interest in avoiding locale dependence? If not I'll close :)

@practicalswift practicalswift deleted the cpp-locale branch April 10, 2021 19:40
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Low level functions ScriptToAsmStr (core_io), i64tostr (strencodings) and itostr (strencodings) are locale dependent
6 participants