public class JsonpCharacterEscapes extends CharacterEscapes
CharacterEscapes implementation that escapes
Unicode characters `0x2028` and `0x2029` (in addition to characters
escaped otherwise), which are apparently considered linefeeds as
per newer Javascript specifications, and consequently problematic
when using JSONP (see https://en.wikipedia.org/wiki/JSONP).ESCAPE_CUSTOM, ESCAPE_NONE, ESCAPE_STANDARD| Constructor and Description |
|---|
JsonpCharacterEscapes() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getEscapeCodesForAscii()
Method generators can call to get lookup table for determining
escape handling for first 128 characters of Unicode (ASCII
characters.
|
SerializableString |
getEscapeSequence(int ch)
Method generators can call to get lookup table for determining
exact escape sequence to use for given character.
|
static JsonpCharacterEscapes |
instance() |
standardAsciiEscapesForJSONpublic static JsonpCharacterEscapes instance()
public SerializableString getEscapeSequence(int ch)
CharacterEscapesgetEscapeSequence in class CharacterEscapespublic int[] getEscapeCodesForAscii()
CharacterEscapesgetEscapeCodesForAscii in class CharacterEscapesESCAPE_xxx constants, or non-zero positive
integer (meaning of which is data format specific; for JSON it means
that combination of backslash and character with that value is to be used)
to indicate that specific escape sequence is to be used.Copyright © 2008–2020 FasterXML. All rights reserved.