public static String getCharRepresentation(DataType dataType, byte[] bytes, Settings settings) {
		if (bytes == null || bytes.length == 0) {
			return UNKNOWN;
		}

		if (bytes.length != 1 && isSingleAsciiValue(bytes)) {
			bytes = new byte[] { bytes[bytes.length - 1] };
		}

		MemBuffer memBuf = new ByteMemBufferImpl(null, bytes, true);
		StringDataInstance sdi = new StringDataInstance(dataType, settings, memBuf, bytes.length);
		return sdi.getCharRepresentation();
	}
Returns a string representation of the character(s) contained in the byte array, suitable for
display as a single character, or as a sequence of characters.

@param dataType the {@link DataType} of the element containing the bytes (most likely a
           ByteDataType)
@param bytes the big-endian ordered bytes to convert to a char representation
@param settings the {@link Settings} object for the location where the bytes came from, or
           null
@return formatted string (typically with quotes around the contents): single character: 'a',
        multiple characters: "a\x12bc"
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java