Page MenuHomePhabricator

Replace std::to_string with locale-independent alternative
ClosedPublic

Authored by PiRK on Jan 12 2021, 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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jan 12 2021, 10:07
Fabien requested changes to this revision.Jan 12 2021, 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.Jan 12 2021, 10:38
majcosta requested changes to this revision.Jan 12 2021, 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.Jan 12 2021, 15:48