| 600 | } |
| 601 | |
| 602 | string Utf8SafeCEscape(const StringPiece& src) { |
| 603 | const int dest_length = src.size() * 4 + 1; // Maximum possible expansion |
| 604 | unique_ptr<char[]> dest(new char[dest_length]); |
| 605 | const int len = CEscapeInternal(src.data(), src.size(), |
| 606 | dest.get(), dest_length, false, true); |
| 607 | DCHECK_GE(len, 0); |
| 608 | return string(dest.get(), len); |
| 609 | } |
| 610 | |
| 611 | string Utf8SafeCHexEscape(const StringPiece& src) { |
| 612 | const int dest_length = src.size() * 4 + 1; // Maximum possible expansion |
no test coverage detected