Fix the pretty-printing of strings
This commit is contained in:
@@ -313,12 +313,13 @@ void quote_string(const eng::string &s, std::ostream *os) {
|
||||
(*os) << c;
|
||||
}
|
||||
} else {
|
||||
unsigned int value = ((unsigned char)c);
|
||||
switch (c) {
|
||||
case '\n': (*os) << "\\n"; break;
|
||||
case '\t': (*os) << "\\t"; break;
|
||||
case '\r': (*os) << "\\r"; break;
|
||||
default:
|
||||
(*os) << "\\" << std::setfill('0') << std::setw(3) << int(c);
|
||||
(*os) << "\\" << std::setfill('0') << std::setw(3) << value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user