Fix search query logging for queries non-ASCII characters