mirror of
https://github.com/Z3Prover/z3
synced 2025-09-29 12:49:02 +00:00
Fix Java API mkString to properly handle Unicode surrogate pairs (#7865)
* Initial plan * Fix Java API mkString to properly handle surrogate pairs Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
9196a3c369
commit
294f0578b0
1 changed files with 1 additions and 1 deletions
|
@ -2032,7 +2032,7 @@ public class Context implements AutoCloseable {
|
|||
public SeqExpr<CharSort> mkString(String s)
|
||||
{
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (int i = 0; i < s.length(); ++i) {
|
||||
for (int i = 0; i < s.length(); i += Character.charCount(s.codePointAt(i))) {
|
||||
int code = s.codePointAt(i);
|
||||
if (code <= 32 || 127 < code)
|
||||
buf.append(String.format("\\u{%x}", code));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue