Handle special characters in HaveTextAssertion