implement and test path_escape and query_escape