public byte[] encodeReplacementFromStringValue(CharSequence value)
			throws CharacterCodingException {
		CharsetEncoder ce = Charset.forName(charsetName).newEncoder();
		ByteBuffer bb = ce.encode(CharBuffer.wrap(value));
		return convertUnpaddedToPadded(checkAndEncodeLayout(bb));
	}
Encode a string to replace the current value

@param value the value to encode
@return the encoded value
@throws CharacterCodingException if a character could not be encoded
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StringDataInstance.java