public static String makeStringLabel(String prefixStr, String str,
			DataTypeDisplayOptions options) {
		boolean needsUnderscore = false;
		Set<UnicodeScript> foundScripts = EnumSet.noneOf(UnicodeScript.class);
		StringBuilder buffer = new StringBuilder();
		for (int i = 0, strLength = str.length(); i < strLength &&
			buffer.length() < options.getLabelStringLength();) {
			int codePoint = str.codePointAt(i);
			if (StringUtilities.isDisplayable(codePoint) && (codePoint != ' ')) {
				if (needsUnderscore) {
					if (!buffer.isEmpty()) {
						buffer.append('_');
					}
					needsUnderscore = false;
				}
				buffer.appendCodePoint(codePoint);
			}
			else {
				foundScripts.add(UnicodeScript.of(codePoint));
				needsUnderscore = true;
				// discard character
			}
			i += Character.charCount(codePoint);
		}
		foundScripts.removeAll(Set.of(UnicodeScript.LATIN, UnicodeScript.COMMON));
		String scriptSummary = "";
		if (!foundScripts.isEmpty()) {
			List<String> scriptNames = new ArrayList<>();
			foundScripts.forEach(script -> scriptNames.add(script.name()));
			Collections.sort(scriptNames);
			scriptSummary = String.join("_", scriptNames) + "#";
		}

		return prefixStr + scriptSummary + buffer.toString();
	}
Formats a string value so that it is in the form of a symbol label.

@param prefixStr data type prefix, see {@link AbstractStringDataType#getDefaultLabelPrefix()}
@param str string value
@param options display options
@return string, suitable to be used as a label
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java