Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 48fdc8d

Browse files
Merge pull request #7243 from trevordevore/tkd-bug-22511
[[ Bug 22511 ]] Fix multi-codepoint character parsing in JSONImport()
2 parents 625c3cc + daafb50 commit 48fdc8d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/notes/bugfix-22511.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Fix multi-codepoint character parsing in JSONImport()
2+

extensions/libraries/json/json.lcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end handler
5353
-- characters are shown in "\uXXXX" format, and other characters are
5454
-- shown literally.
5555
private handler FormatChar(in pChar as String) returns String
56-
if the code of pChar > 0x1f then
56+
if the code of codeunit 1 of pChar > 0x1f then
5757
return pChar
5858
else
5959
return "\\u" & (the code of pChar converted to base 16)
@@ -269,7 +269,7 @@ public handler JsonImport(in pJson as String) returns optional any
269269
put kScanEndToken into tScanState
270270
else if tChar is "\\" then
271271
put kScanInStringEscape into tScanState
272-
else if the code of tChar <= 0x1f then
272+
else if the code of codeunit 1 of tChar <= 0x1f then
273273
-- RFC 7159 requires control characters inside string literals
274274
-- to be escaped. Control characters are those within the
275275
-- range U+0000 to U+001F inclusive

0 commit comments

Comments
 (0)