edit query.py to encode utf-8