_escape function throws error for some binary strings and blobs. The multi-byte unicode conditions do not check for string length before accessing multi-byte characters, so code tries to iterate past the end of the string.
#require "JSONEncoder.class.nut:2.0.0"
local binStr = "\xe8\x03\x00\x00\x01\x00\x00\xc0";
server.log(JSONEncoder.encode(binStr));