q() Tableau Query escape character

I’m looking for a way to escape certain queries in Tableau’s q() function. 

Issues with ? and "

Any help appreciated! Thanks!

Where do these special characters occur? Can you give us some examples of the queries that you want to escape?