These routines handle converting strings to and from a printable form,
namely, doubly-quoted strings with C backslash escapes.
encodes the string
using only printable characters and returns the result, which will begin
and end with a double quote character.
The returned string is allocated with
and must be freed by the caller.
reads and parses a doubly-quoted string from
and returns the result, allocated with
The caller must free the returned string.
The input stream is assumed to be pointing at the character after the
opening double quote character.
Upon return, it will be pointing to the character after the closing double
parses in a liberal manner and does not detect parse errors.
Any malformed backslash escapes are passed through unchanged.
In other words, if
is passed a string that was produced by
it guarantees to reproduce the original string;
however, it will successfully parse any input string.