public byte[] encodeReplacementFromStringRepresentation(CharSequence repr)
			throws MalformedInputException, UnmappableCharacterException, StringParseException {
		AdjustedCharsetInfo aci = getAdjustedCharsetInfo();
		StringRenderParser parser = new StringRenderParser(StringRenderBuilder.DOUBLE_QUOTE,
			aci.endian, aci.charsetName, aci.byteStartOffset != 0);
		ByteBuffer bb = parser.parse(CharBuffer.wrap(repr));
		return convertUnpaddedToPadded(checkAndEncodeLayout(bb));
	}
Parse and encode a string from its representation to replace the current value

@param repr the representation of the string
@return the encoded value
@throws StringParseException if the representation could not be parsed
@throws UnmappableCharacterException if a character could not be encoded
@throws MalformedInputException if the input contains invalid character sequences
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java