public static String convertControlCharsToEscapeSequences(String str) {
		StringBuilder builder = new StringBuilder();
		int strLength = str.length();
		int charCount = 1;
		for (int i = 0; i < strLength; i += charCount) {
			int codePoint = str.codePointAt(i);
			charCount = Character.charCount(codePoint);
			if (charCount == 1 && controlToEscapeStringMap.containsKey((char) codePoint)) {
				builder.append(controlToEscapeStringMap.get((char) codePoint));
			}
			else {
				builder.appendCodePoint(codePoint);
			}
		}
		return builder.toString();
	}
Replaces known control characters in a string to corresponding escape sequences. For example
a string containing a line feed character would be converted to backslash character followed
by an 'n' character. One use for this is to display strings in a manner to easily see the
embedded control characters.

The string that contains 'a','b','c',0x0a,'d', 0x01, 'e' would become 'a','b','c', '\', 'n',
'd', 0x01, 'e'

@param str The string to convert control characters to escape sequences
@return a new string with all the control characters converted to escape sequences.
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java