diff options
| author | Albert Cervin <albert@acervin.com> | 2025-11-26 23:34:08 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2025-11-26 23:34:08 +0100 |
| commit | f06d8923e86a2af70f9c97f8484dc9e645dcefdb (patch) | |
| tree | a2fce0ab790dda09bfb33544622f65d7953fc898 /test/json.c | |
| parent | b8f2c54675cfd4c89c13941503fb23eda0ad082d (diff) | |
| download | dged-f06d8923e86a2af70f9c97f8484dc9e645dcefdb.tar.gz dged-f06d8923e86a2af70f9c97f8484dc9e645dcefdb.tar.xz dged-f06d8923e86a2af70f9c97f8484dc9e645dcefdb.zip | |
Handle unicode chars when unescaping JSON
The python LSP used some nbsp unicode chars when sending back
documentation.
Diffstat (limited to 'test/json.c')
| -rw-r--r-- | test/json.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/json.c b/test/json.c index 0243ee3..720ebfc 100644 --- a/test/json.c +++ b/test/json.c @@ -190,6 +190,12 @@ static void test_str_escape(void) { struct s8 res2 = unescape_json_string(s8(" \\\\\\n")); ASSERT(s8eq(res2, s8(" \\\n")), "Expected \\ and \\n to not be removed"); s8delete(res2); + + struct s8 res3 = unescape_json_string( + s8("\\n \\u26f0 \\u2702 \\u00a0\\u00a0\\u00a0\\u00a0")); + ASSERT(s8eq(res3, s8("\n ⛰ ✂ \u00a0\u00a0\u00a0\u00a0")), + "Expected unicode decoding to work."); + s8delete(res3); } void run_json_tests(void) { |
