Function Block JSON_OPTIONS

The Function Block JSON_OPTIONS calculates the options for JSON_ENCODE.

Input FORCE_OBJECT

Outputs an object instead of an array if a non-associative array is used. Particularly useful when the recipient of the output expects an object and the array is empty.

Input PARTIAL_OUTPUT_ON_ERROR

If encoding a single value fails, it is omitted instead of failing.

Input NUMERIC_CHECK

Encodes numeric strings as numbers.

Input PRETTY_PRINT

Uses whitespace to format the returned data.

Input HEX_TAG

All < and > are converted to \u003C and \u003E.

Input HEX_AMP

All &-characters are converted to \u0026.

Input HEX_APOS

All '-characters are converted to \u0027.

Input HEX_QUOT

All "-characters are converted to \u0022.

Input UNESCAPED_SLASHES

No escape character is inserted before /.

Input UNESCAPED_UNICODE

Encodes Unicode characters consisting of multiple bytes directly. By default, \uXXXX escapes are used.

Output Q

Returns the calculated options as an integer. The value 0 corresponds to no option. To save space, the value can also be inserted directly into the Function Block JSON_ENCODE.

See Also