Handle query criteria as unicode to avoid ``UnicodeDecodeError``.