[web] Quote query before doing IDN stuff

This will prevent IDN functions from messing up queries with non-ascii characters