Don’t rely on locale dependent function std::isspace
in base_blob<BITS>::SetHex(...)
(uint256), DecodeBase58(...)
, ParseMoney(...)
and ParseHex(...)
.
Rationale:
0$ uname -s
1Darwin
2$ cat poc.cpp
3#include <iostream>
4#include <locale>
5
6int main(void) {
7 setlocale(LC_ALL, "");
8 std::cout << std::isspace(133) << ' ' << std::isspace(154) << ' ' << std::isspace(160);
9 std::cout << '\n';
10}
11$ clang++ -o poc poc.cpp
12$ ./poc
131 0 1
14$ LC_ALL=en_US ./poc
151 0 1
16$ LC_ALL=C ./poc
170 0 0
18$ LC_ALL=ru_RU.KOI8-R ./poc # an "interesting" locale
190 1 0