This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

jsonstringify Operator

29th October 2017 at 3:51pm
Filter Operators String Operators
purposeapply JSON string encoding to a string
inputa selection of titles
suffixR = New in: 5.1.23 optionally, the keyword rawunicode
outputthe input with JSON string encodings applied
New in: 5.1.14

The following substitutions are made:

CharacterReplacementCondition
\\\Always
"\"Always
Carriage return (0x0d)\\rAlways
Line feed (0x0a)\\nAlways
Backspace (0x08)\\bAlways
Form field (0x0c)\\fAlways
Tab (0x09)\\tAlways
Characters from 0x00 to 0x1f\\u#### where #### is four hex digitsAlways
Characters from 0x80 to 0xffff\\u#### where #### is four hex digitsIf rawunicode suffix is not present (default)
Characters from 0x80 to 0xffffUnchangedIf 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.

Note
Technical note: Characters outside the Basic Multilingual Plane, such as ๐ŸŽ„ and other emojis, will be encoded as a UTF-16 surrogate pair, i.e. with two \u sequences.

Also see the stringify Operator.

Examples