I am using the jQuery plugin autocomplete on an country input field: I got this php array with countries in dutch: $global_countries = array(); $global_countries['AF'] = 'Afghanistan'; $global_countries['AX'] = 'Ålandseilanden'; $global_countries['AL'] = 'Albanië'; ...
Then php implodes the array and evals a html file to fill the js var. This is in my html file: var countries = [$countries]; $("#country").autocomplete(countries, { minChars: 2, max: 12, autoFill: false, mustMatch: true, matchContains: true, scrollHeight: 220 }); But now, when I start to type a country I get ALL special characters like: Belgi� If I use php htmlentities on each country it is displayed like it should in the select list, but when selected I see the ASCII code of course. België becomes België