I am using ajax request to send a value from client side to server side to update in mysql database using ajax request. The value is in hindi language (हिन्दी मतलब जाने). But on client side when i alert it i get the hindi text as shown above but after the server side request is processed it gets inserted in the database as à ¤¹à ¤¿à ¤¨à ¥Âà ¤¦à ¥€ à ¤®à ¤¤...While if i use alert in my javascript for request.ResponseText
then it shows correctly as हिन्दी मतलब जाने. Now again if i load the page the updated value gets displayed as ¤Â¹Ã ¤¿à ¤¨à ¥Âà ¤¦à ¥€ à ¤®à ¤¤... but the values which were not updated previously displays correctly as हिन्दी मतलब जाने.
i have used in the client side
var requestDatah = "values=" +
escape(valued) +"&texts=" +
encodeURIComponent(texted);
request1h[k].setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8;");
request1h[k].send(requestDatah);
and on the server side header with php
<?php header("Content-Type: text/html; charset=utf-8");
mysqli_set_charset($con,"utf8");
Please help me how to store correctly in mysql and display ?