21 static const char* hex_digits =
"0123456789abcdef";
23 out.reserve(in.length() * 1.2);
24 for (std::string::const_iterator it = in.begin(); it != in.end(); ++it) {
36 else if (0x0 <= c && c < 0x20) {
38 out += hex_digits[c >> 4];
39 out += hex_digits[c & 0xf];
52 fwrite(out.c_str(), 1, out.length(), stdout);
void PrintJSONString(const std::string &in)
std::string EncodeJSONString(const std::string &in)