3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 10:25:18 +00:00

adding unicode fixup base on #4939 discussion

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-01-27 20:21:46 -08:00
parent a526eea123
commit 49aebdbb02

View file

@ -10138,6 +10138,7 @@ def is_string_value(a):
def StringVal(s, ctx=None):
"""create a string expression"""
s = "".join(str(ch) if ord(ch) < 128 else "\\u{%x}" % (ord(ch)) for ch in s)
ctx = _get_ctx(ctx)
return SeqRef(Z3_mk_lstring(ctx.ref(), len(s), s), ctx)