protected String readAndClear(ByteBuffer buf) {
		buf.flip();
		String result = new String(buf.array(), buf.position(), buf.remaining(), WINDOWS_1252);
		buf.clear();
		return result;
	}
There's not really a good way to know if any trailing space was intentional. For GDB/MI, that
doesn't really matter.
Ghidra/Framework/Pty/src/main/java/ghidra/pty/windows/AnsiBufferedInputStream.java