encoding for query builder