| 40 | } |
| 41 | |
| 42 | std::string static EncodeDumpString(const std::string &str) { |
| 43 | std::stringstream ret; |
| 44 | for (unsigned char c : str) { |
| 45 | if (c <= 32 || c >= 128 || c == '%') { |
| 46 | ret << '%' << HexStr(&c, &c + 1); |
| 47 | } else { |
| 48 | ret << c; |
| 49 | } |
| 50 | } |
| 51 | return ret.str(); |
| 52 | } |
| 53 | |
| 54 | static std::string DecodeDumpString(const std::string &str) { |
| 55 | std::stringstream ret; |
no test coverage detected