| 52 | |
| 53 | namespace wallet { |
| 54 | std::string static EncodeDumpString(const std::string &str) { |
| 55 | std::stringstream ret; |
| 56 | for (const unsigned char c : str) { |
| 57 | if (c <= 32 || c >= 128 || c == '%') { |
| 58 | ret << '%' << HexStr({&c, 1}); |
| 59 | } else { |
| 60 | ret << c; |
| 61 | } |
| 62 | } |
| 63 | return ret.str(); |
| 64 | } |
| 65 | |
| 66 | static std::string DecodeDumpString(const std::string &str) { |
| 67 | std::stringstream ret; |
no test coverage detected