static String getCharsetNameFromDataTypeOrSettings(DataType dataType, Settings settings) {
		if (dataType instanceof BitFieldDataType bfdt) {
			dataType = bfdt.getBaseDataType();
		}
		return (dataType instanceof DataTypeWithCharset dtwcs)
				? dtwcs.getCharsetName(settings)
				: DEFAULT_CHARSET_NAME;
	}
Creates a string instance using the data in the {@link MemBuffer} and the settings pulled
from the {@link AbstractStringDataType string data type}.

@param dataType {@link DataType} of the string, either a {@link AbstractStringDataType}
           derived type or an {@link ArrayStringable} element-of-char-array type.
@param settings {@link Settings} attached to the data location.
@param buf {@link MemBuffer} containing the data.
@param length Length passed from the caller to the datatype. -1 indicates a 'probe' trying to
           detect the length of an unknown string, otherwise it will be the length of the
           containing field of the data instance.
@param isArrayElement boolean flag, true indicates that the specified dataType is an element
           in an array (ie. char[] vs. just a plain char), causing the string layout to be
           forced to {@link StringLayoutEnum#NULL_TERMINATED_BOUNDED}
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java