private void encodeString(String text, StringBuffer buf) {
		if (text == null) {
			return;
		}
		for (int i = 0; i < text.length(); i++) {
			char next = text.charAt(i);
			switch (next) {
				case '\n':
					buf.append("\\n");
					break;
				case '\r':
					buf.append("\\r");
					break;
				case ';':
					buf.append("\\s");
					break;
				case '\\':
					buf.append("\\\\");
					break;
				default:
					buf.append(next);
			}
		}
	}
Escape special characters within a string and output to string buffer.
@param text text string to be escaped
@param buf output buffer
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/HistoryManager.java