Bug in textutils.unserialiseJSON()
JakobDev opened this issue ยท 1 comments
While writing a new package manager for CC (not for a PR) that used json files, I discoverd a bug. This JSOn file does not work with textutils.unserialiseJSON(). Example code to reproduce:
local h = http.get("https://gitlab.com/JakobDev/Computercraft/-/raw/master/ccptrepo.json")
local sText = h.readAll()
h.close()
local tContent, sError = textutils.unserialiseJSON(sText)
if not tContent the: Unexn
print(sError)
end
Throws the following error:
Malformed JSON at position 3: Unexpected " ", expected object key
For some silly reason we've got vertical tab here (\v
) instead of horizontal (\t
). I evidently wasn't thinking.