Ok, nice! Will have a look in due time.
?- set_prolog_flag(double_quotes, string).
?- writeq(add([0,1,2,'abc\uFEFFdef'])), write(';'), nl.
?- write(add([0,1,2,"abc\uFEFFdef"])), write(';'), nl.
The generated printable JSON is also JSON compatible. Since its in the scope of JSON syntax. Maybe for a “minified” output, I might provide some way to print directly non-printables. Since this possibly needs less space. So possibly also some new “minified” flag in the pipeline here.
I only need a “minified” flag. I don’t need a “\uXXXX” flag, this is regulated by the Prolog datatype atom or string. Since Prolog datatype string and the “\uXXXX” syntax is anyway not in the ISO core standard, I guess there is room to make these decisions.