public byte[] encodeReplacementFromCharValue(char[] value) throws CharacterCodingException {
		CharsetEncoder ce = Charset.forName(charsetName).newEncoder();
		ByteBuffer bb = ce.encode(CharBuffer.wrap(value));
		return Arrays.copyOf(bb.array(), bb.limit());
	}
Encode a single character to replace the current value

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