purpose | apply JSON string encoding to a string |
---|---|
input | a selection of titles |
suffix | R = New in: 5.1.23 optionally, the keyword rawunicode |
output | the input with JSON string encodings applied |
The following substitutions are made:
Character | Replacement | Condition |
---|---|---|
\ | \\ | Always |
" | \" | Always |
Carriage return (0x0d) | \\r | Always |
Line feed (0x0a) | \\n | Always |
Backspace (0x08) | \\b | Always |
Form field (0x0c) | \\f | Always |
Tab (0x09) | \\t | Always |
Characters from 0x00 to 0x1f | \\u#### where #### is four hex digits | Always |
Characters from 0x80 to 0xffff | \\u#### where #### is four hex digits | If rawunicode suffix is not present (default) |
Characters from 0x80 to 0xffff | Unchanged | If rawunicode suffix is present New in: 5.1.23 |
New in: 5.1.23 If the suffix rawunicode
is present, Unicode characters above 0x80 (such as ร, รค, รฑ or ๐) will be passed through unchanged. Without the suffix, they will be substituted with \\u
codes, which was the default behavior before 5.1.23.
\u
sequences.Also see the stringify Operator.