3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

string escaping

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-01-30 04:58:58 -08:00
parent c99b805c14
commit 520b24aab4
3 changed files with 4 additions and 5 deletions

View file

@ -137,7 +137,7 @@ std::string zstring::encode() const {
#define _flush() if (offset > 0) { buffer[offset] = 0; strm << buffer; offset = 0; }
for (unsigned i = 0; i < m_buffer.size(); ++i) {
unsigned ch = m_buffer[i];
if (ch < 32 || ch >= 128) {
if (ch < 32 || ch >= 128 || ch == '\\') {
_flush();
strm << "\\u{" << std::hex << ch << std::dec << "}";
}