private static void appendCharConvertedToEscapeSequence(int c, int charSize,
			StringBuilder builder) {
		if (controlToEscapeStringMap.containsKey((char) c)) {
			builder.append(controlToEscapeStringMap.get((char) c));
		}
		else if (c >= 0x20 && c <= 0x7f) {
			builder.append((char) c);
		}
		else if (charSize <= 1) {
			builder.append("\\x" + pad(Integer.toHexString(c), '0', 2));
		}
		else if (charSize == 2) {
			builder.append("\\u" + pad(Integer.toHexString(c), '0', 4));
		}
		else if (charSize <= 4) {
			builder.append("\\U" + pad(Integer.toHexString(c), '0', 8));
		}
		else {
			// TODO: unsupported
		}
	}
Generate a quoted string from US-ASCII characters, where each character is charSize bytes.
<p>
Special characters and non-printable characters will be escaped using C character escape
conventions (e.g., \t, \n, \\uHHHH, etc.).
<p>
The result string will be single quoted (ie. "'") if the input byte array is 1 character long
(ie. charSize), otherwise the result will be double-quoted ('"').

@param bytes array of bytes
@param charSize number of bytes per character (1, 2, 4).
@return escaped string for display use
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java