add utf-8 encoding and query term escaping