33 desc.reserve(desc.size() + s.size());
35 unsigned ch = i.strict_deref();
36 if ((ch & 0x80000000) == 0 && ch >=
' ' && ch !=
'\\' && ch != 127) {
39 desc.append(
"\\x", 2);
40 desc +=
"0123456789abcdef"[(ch >> 4) & 0x0f];
41 desc +=
"0123456789abcdef"[ch & 0x0f];
Unicode and UTF-8 related classes and functions.
void append_utf8(std::string &s, unsigned ch)
Append the UTF-8 representation of a single Unicode character to a std::string.
void description_append(std::string &desc, const std::string &s)
Append a string to an object description, escaping invalid UTF-8.
An iterator which returns Unicode character values from a UTF-8 encoded string.