Escaping Double Quotes in IMAP Search String

You can use the string Literal format (as opposed to Quoted format)

01 SEARCH SUBJECT {21}
<Wait for server to acknowledge>
this's is a "TEST" of "quote's"

https://www.rfc-editor.org/rfc/rfc3501#section-4.3

A literal is a sequence of zero or more octets (including CR and
LF), prefix-quoted with an octet count in the form of an open brace ("{"), the number of octets, close brace ("}"), and CRLF. In the case of literals transmitted from server to client, the CRLF is immediately followed by the octet data. In the case of literals transmitted from client to server, the client MUST wait to receive a command continuation request (described later in this document) before sending the octet data (and the remainder of the command).