public default byte[] encodeCharacterRepresentation(String repr, MemBuffer buf,
			Settings settings) throws DataTypeEncodeException {
		StringDataInstance sdi = new StringDataInstance(this, settings, buf, getLength());
		try {
			return sdi.encodeReplacementFromCharRepresentation(repr);
		}
		catch (Throwable e) {
			throw new DataTypeEncodeException(repr, this, e);
		}
	}
Utility for character data types to encode a representation.

@param repr the single-character string to encode.
@param buf a buffer representing the eventual destination of the bytes.
@param settings the settings to use.
@return the encoded value
@throws DataTypeEncodeException if the value cannot be encoded
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeWithCharset.java