Replace uses of boost::trim* with locale-independent alternatives (#18130 rebased)#22859
Replace uses of boost::trim* with locale-independent alternatives (#18130 rebased)#22859fanquake merged 3 commits intobitcoin:masterfrom
Conversation
Note the only use of readStdin is fed to DecodeHexTx, which fails in IsHex on non-hex characters as recorded in p_util_hexdigit.
|
Concept ACK |
|
utACK 696c76d |
|
Very happy to see a reduction in our locale dependency! I think we'll be able to have an empty ACK 696c76d |
| std::string strUserPass64 = strAuth.substr(6); | ||
| boost::trim(strUserPass64); | ||
| std::string strUserPass64 = TrimString(strAuth.substr(6)); | ||
| std::string strUserPass = DecodeBase64(strUserPass64); |
There was a problem hiding this comment.
9355186 nit, these can be const
- std::string strUserPass64 = TrimString(strAuth.substr(6));
- std::string strUserPass = DecodeBase64(strUserPass64);
+ const std::string strUserPass64 = TrimString(strAuth.substr(6));
+ const std::string strUserPass = DecodeBase64(strUserPass64);
theStack
left a comment
There was a problem hiding this comment.
Code-review ACK 696c76d
Happy to also re-ACK if Jon's suggestion of declaring strUserPass{64} as const (#22859 (comment)) is applied.
| boost::algorithm::trim_right(ret); | ||
|
|
||
| return ret; | ||
| return TrimString(ret); |
There was a problem hiding this comment.
Why? It isn't trying to read native-language text.
There was a problem hiding this comment.
It's interacting with the CLI, which is expected to behave in the user's configured locale.
There was a problem hiding this comment.
When processing text, or other locale-formatted things like dates/..., I can see that. But this is just accepting hex-encoded tx data?
This is #18130 rebased.