jquerycharacter-encodingnon-unicode

jQuery and non-unicode characters


I'm trying to use jQuery to get autocomplete from a database. It works fine with English values but I have some rows in Arabic and they are showing as (????).

I start all my pages with:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<Link href="style2.css" rel="stylesheet" type="text/css">
<style type="text/css"></style>

My database is formatted in UTF8. I also include the connection to DB file which says :

$conn = mysql_connect("localhost","root","") or die ($dberror1);
mysql_select_db("finishing", $conn);
mysql_query("SET NAMES 'utf8'"); 
mysql_query('SET CHARACTER SET utf8')

Note: all my other items in Arabic work fine. It's just the jQuery autocomplete that I am having issues with.


Solution

  • Ok it is solved , simply by including the connection to DB script in the search file , apparently when i was referring to an external file there was a conflict of variables. The script that worked is exactly what i previously posted .. What amazed me though, is that i spent all day looking thru the internet and there aren't any clear answers to the non-unicode problem .. Therefore i advise (in my humble opinion to always include these 4 lines of script in all your files in you are working in a non unicode language ..thankyou for everyone who tried to help