protected boolean shouldUseUnicodeEscapeForCodePointInDoubleQuotedString(int codePoint) {
		// We don't want anyone passing 0x0A (newline) or 0x22
		// (double-quote) here because Java treats \\u000A as
		// a literal newline and \\u0022 as a literal
		// double-quote, so Unicode escaping doesn't help.
		assert codePoint != 0x0A && codePoint != 0x22;

		return
			codePoint < 0x20  || // control characters up to but not including space
			codePoint == 0x5C || // backslash
			codePoint >= 0x7F;   // DEL and beyond (keeps source code 7-bit US-ASCII)
	}
<p>Convert from an ANTLR string literal found in a grammar file to an
equivalent string literal in the target language.
</p>
<p>
For Java, this is the translation {@code 'a\n"'} &rarr; {@code "a\n\""}.
Expect single quotes around the incoming literal. Just flip the quotes
and replace double quotes with {@code \"}.
</p>
<p>
Note that we have decided to allow people to use '\"' without penalty, so
we must build the target string in a loop as {@link String#replace}
cannot handle both {@code \"} and {@code "} without a lot of messing
around.
</p>
tool/src/org/antlr/v4/codegen/Target.java