I'm using all ASCII characters in my code blocks, so I need to reach for non-ASCII ones for the escape characters. I expected Xetex to deal with this just fine; alas, it doesn't seem to be the case.
\documentclass{memoir}
\usepackage{listings}
\lstset{escapeinside=〈〉}
\begin{document}
\begin{lstlisting}
foo bar baz〈\textit{hello}〉
\end{lstlisting}
\end{document}
When typeset by running latexmk -xelatex foo.tex, this results in a code listing that contains "\textit{hello}" instead of "hello".
How do I use non-ASCII escape characters within lstlisting?

bazand〈\textit{hello}〉, then there is a space between "baz" and "hello". – Cactus Jun 02 '21 at 12:43