A correct JSON is
[{
"user_id": 1,
"user_name": "John Doe I"
}, {
"user_id": 2,
"user_name": "Jane Doe III"
}]
But if it contains some illegal characters it will not validate. Like this with a CR after Doe:
[{"user_id":1,"user_name":"John Doe
I"},{"user_id":2,"user_name":"Jane Doe III"}]
My question is if there is a "clean up" function in Omnis Studio 8 where the output is a correct JSON?
EDIT
To replace or delete KNOWN characters is easy. The problem is that text copied from MS Word and the Web can contain UNKNOWN characters. So I am searching for a command like
Calculate VALIDJSON as keepvalidchar(NOTVALIDJSON)
Is there such a beast?
Are you simply looking for a
function call?
Thus replacing the CR character with the escaped normal encoding of '\n'
I guess the other question is, are you creating the JSON to send, or receiving the JSON and trying to decode it?
If receiving, maybe OJSON.$formatjson() may help?