Low level functions ScriptToAsmStr
(core_io
), i64tostr
(strencodings
) and itostr
(strencodings
) are locale dependent:
0const std::vector<uint8_t> b{0x6a, 0x4, 0xff, 0xff, 0xff, 0xff};
1const CScript script{b.begin(), b.end()};
2for (const std::string& locale_string : {"C", "de_DE"}) {
3 std::locale::global(std::locale(locale_string));
4 std::cout << "[" << locale_string << "] ScriptToAsmStr(script, false) == "
5 << ScriptToAsmStr(script, false) << "\n";
6 std::cout << "[" << locale_string << "] i64tostr(12345678) == "
7 << i64tostr(12345678) << "\n";
8 std::cout << "[" << locale_string << "] itostr(12345678) == "
9 << itostr(12345678) << "\n";
10}
0[C] ScriptToAsmStr(script, false) == OP_RETURN -2147483647
1[C] i64tostr(12345678) == 12345678
2[C] itostr(12345678) == 12345678
3[de_DE] ScriptToAsmStr(script, false) == OP_RETURN -2.147.483.647
4[de_DE] i64tostr(12345678) == 12.345.678
5[de_DE] itostr(12345678) == 12.345.678