3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 23:05:46 +00:00

updated C++ API for escaped and unescaped strings #5615

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-10-21 14:52:59 -04:00
parent 05e7ed9637
commit f05ac8a429
5 changed files with 18 additions and 14 deletions

View file

@ -187,10 +187,9 @@ extern "C" {
svector<char> buff;
for (unsigned i = 0; i < str.length(); ++i) {
unsigned ch = str[i];
if (ch <= 32 || ch >= 127) {
if (ch <= 32 || ch >= 127 || (ch == '\\' && i + 1 < str.length() && str[i+1] == 'u')) {
buff.reset();
buffer.push_back('\\');
// buffer.push_back('\\'); // possibly replace by native non-escaped version?
buffer.push_back('u');
buffer.push_back('{');
while (ch > 0) {