json.lua icon indicating copy to clipboard operation
json.lua copied to clipboard

Bug with encoding hex characters with letters

Open Fabimawn opened this issue 7 months ago • 1 comments

The line: local testStr = jsonLua.encode("\x03test\x7a") Outputs: "\u0003testz"

The first HEX charater is converted correctly, the second one isn't. If I make the second one a HEX only consisting of a number it converts correctly. It doesn't matter if you use upper or lower case, alphanumerics in the HEX character doesn't seem to work.

Fabimawn avatar Apr 30 '25 09:04 Fabimawn

It seems to work up to 1F. Is it only escaping control characters? Probably design choice then.

Fabimawn avatar Apr 30 '25 09:04 Fabimawn