Bugfix - non-ascii chars made the script crash

Script doesn't crash when non-ascii chars are used - they are just removed from the query.