fix typeahead encoding