Function JsonEncode() Foundation
Converts a character string to JSON text.
JsonEncode( <cString> ) -> cJsonString
A character string with the JSON text encoded in UTF-8.
The JsonEncode() function converts an Xbase++ character string into JavaScript Object Notation (JSON) text conforming to RFC 7159, Section 7. The returned string is UTF-8 encoded. However, certain characters such as the quotation mark are escaped in the JSON string. These escaped characters appear in the notation "\uXXXX". XXXX is a four-digit hexadecimal number which identifies the corresponding Unicode code point.
The following table lists the characters which are escaped along with their representation in the JSON string.
Character | Escaped representation |
---|---|
" (quotation mark) | \U0022 |
\ (reverse solidus) | \U005C |
/ (solidus) | \U002F |
b (backspace) | \U0008 |
f (form feed) | \U000C |
n (line feed) | \U000A |
r (carriage return) | \U000D |
t (tab) | \U0009 |
More information on the JavaScript Object Notation syntax can be found in RFC 7159: https://tools.ietf.org/html/rfc7159#section-7.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.