encode search string