add helper method for encoding strings for URLs