112 std::ostringstream oss;
113 std::size_t current_size = 0;
114 for (
const char c : original_name) {
127 if (!absl::ascii_iscntrl(c)) {
137 const std::string escaped_c =
138 absl::StrCat(
"\\x", absl::Hex(c, absl::kZeroPad2));
143 current_size += escaped_c.size();
146 const std::string ret = oss.str();
147 DCHECK_EQ(ret.size(), current_size);