MCPcopy Create free account
hub / github.com/google/gson / mustEscapeCharInJsString

Method mustEscapeCharInJsString

src/main/java/com/google/gson/Escaper.java:125–132  ·  view source on GitHub ↗
(int codepoint)

Source from the content-addressed store, hash-verified

123 }
124
125 private boolean mustEscapeCharInJsString(int codepoint) {
126 if (!Character.isSupplementaryCodePoint(codepoint)) {
127 char c = (char) codepoint;
128 return JS_ESCAPE_CHARS.contains(c)
129 || (escapeHtmlCharacters && HTML_ESCAPE_CHARS.contains(c));
130 }
131 return false;
132 }
133
134 private static boolean isControlCharacter(int codePoint) {
135 // JSON spec defines these code points as control characters, so they must be escaped

Callers 1

escapeJsonStringMethod · 0.95

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected