PHP/JSONP/Mysql -> latin1 to ASCII on the fly
Posted on 2012-04-11
I have a customer who is using latin1 character set in their db and I am busy making an application that gets information from the DB via PHP and returns it via JSONP
Im getting the data fine using JSONP except some rows have special chracters, example:
So json_encode() doesnt like this value and just nulls it.
I would like to know if its possible, at the "MySQL Level" (my sql statement) - if its possible to convert any non ASCII characters to full ASCII so that I dont get this issue (ie, something like "Guimaraes,José" would get converted to "Guimaraes,Jose"