summaryrefslogtreecommitdiff
path: root/reencode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-16 19:06:46 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-18 22:45:54 -0700
commit00187950437a10952b82353405e5ba4b4515fb29 (patch)
tree826c4ff76310bf6f58e79f37f2107c329810aaa8 /reencode.go
parenta87d6cbbb51a19071c5c742ef3c91bbb90a727c6 (diff)
reencode: Don't normalize the capitalization of \uXXXX hex escapes
Diffstat (limited to 'reencode.go')
-rw-r--r--reencode.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/reencode.go b/reencode.go
index 1943b9c..7439bf0 100644
--- a/reencode.go
+++ b/reencode.go
@@ -441,8 +441,9 @@ func (enc *ReEncoder) handleRuneType(c rune, t jsonparse.RuneType, stackSize int
enc.uhex[2] = byte(c)
return nil
case jsonparse.RuneTypeStringEscUD:
+ mode := hexToMode(enc.uhex[0], enc.uhex[1], enc.uhex[2], byte(c))
c = hexToRune(enc.uhex[0], enc.uhex[1], enc.uhex[2], byte(c))
- return enc.out.HandleRune(c, jsonparse.RuneTypeStringChar, BackslashEscapeUnicode, stackSize)
+ return enc.out.HandleRune(c, jsonparse.RuneTypeStringChar, mode, stackSize)
case jsonparse.RuneTypeError:
panic(fmt.Errorf("should not happen: handleRune called with %#v", t))
default: