Page MenuHomePhabricator

Replace std::to_string with locale-independent alternative
ClosedPublic

Authored by PiRK on Tue, Jan 12, 10:07.

Details

Summary

std::to_string relies on the current locale for formatting purposes

This is a backport of Core PR18134 and PR17851

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

PiRK requested review of this revision.Tue, Jan 12, 10:07
Fabien requested changes to this revision.Tue, Jan 12, 10:38
Fabien added a subscriber: Fabien.

Please also backport https://github.com/bitcoin/bitcoin/pull/17851. You can easily squash them, and that will prevent from introducing the issue again.

This revision now requires changes to proceed.Tue, Jan 12, 10:38
majcosta requested changes to this revision.Tue, Jan 12, 11:04
majcosta added a subscriber: majcosta.
majcosta added inline comments.
src/test/util/setup_common.cpp
31 ↗(On Diff #26869)

this probably shouldn't be in both the header and the cpp file

add std::to_string to LocaleDependenceLinter.php (this is a backport of Core PR17851), replace std::to_string in a few more source files detected by the linter and remove #include <util/string.h> from setup_common.cpp when it is already included in the header file.

This revision is now accepted and ready to land.Tue, Jan 12, 15:48