private String appendCharDataTypeFormattedHTML(String prevCharVal, DataType charDt,
			ByteMemBufferImpl charMemBuffer, StringBuilder htmlText) {
		// appends a HTML table row to the string builder with the scalar displayed as the
		// specified data type, only if its a value that hasn't already been added to the buffer.

		if (charMemBuffer.getLength() >= charDt.getLength()) {
			StringDataInstance sdi = StringDataInstance.getStringDataInstance(charDt, charMemBuffer,
				SettingsImpl.NO_SETTINGS, charMemBuffer.getLength());
			boolean isArray = (charMemBuffer.getLength() >= charDt.getLength() * 2);
			String charVal = sdi.getStringValue();
			String charRep = isArray ? sdi.getStringRepresentation() : sdi.getCharRepresentation();

			// if the string-ified char data is the same as the previous instance, or if it
			// doesn't have a quote mark in it (ie. all bytes sequences), skip it
			boolean shouldSkip = prevCharVal.equals(charVal)  // 
				|| !charRep.contains(isArray ? "\"" : "'") //
				|| hasEncodingError(charVal);
			if (!shouldSkip) {
				htmlText.append("<tr><td>") // 
						.append(charDt.getName()) //
						.append(isArray ? "[]" : "");
				htmlText.append("</td><td>") //
						.append(HTMLUtilities.friendlyEncodeHTML(charRep)) //
						.append("</td></tr>");
				prevCharVal = charVal;
			}
		}
		return prevCharVal;
	}
A hover service to show tool tip text for hovering over scalar values.
The tooltip shows the scalar in different bases.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/hover/AbstractScalarOperandHover.java