3 ms·
A non-allocating library would be forced to return to you the unparsed string literal, since returning a parsed string can require an allocation. It might tell
by deathanatos 2y ago
A non-allocating library would be forced to return to you the unparsed string literal, since returning a parsed string can require an allocation. It might tell you that the literal is valid.
E.g., take the JSON:
"\"\uD83D\uDCA9\""
There's no (pointer, length) into that that you can then printf(…, ptr, len); you'd get the escapes, raw.
Ofc., there might be situations like debugging where that's fine.