I'm using JavaScript to get the elements under the clicked elements in my website. And I'm sending the content to server side.
But some times, I'm getting some invalid characters like: â€
, â–º
, etc.
What is the reason for this? And how to correct it?
I'm using JavaScript to get the elements under the clicked elements in my website. And I'm sending the content to server side.
But some times, I'm getting some invalid characters like: â€
, â–º
, etc.
What is the reason for this? And how to correct it?
Share Improve this question edited Mar 26, 2015 at 20:24 Rizier123 59.7k17 gold badges104 silver badges164 bronze badges asked Aug 13, 2012 at 0:15 StrangerStranger 10.7k18 gold badges84 silver badges120 bronze badges 2- @HugoDozois Can you please give me an example? – Stranger Commented Aug 13, 2012 at 0:19
- look at php/manual/fr/function.utf8-encode.php and php/manual/fr/function.utf8-decode.php – Hugo Dozois Commented Aug 13, 2012 at 0:21
2 Answers
Reset to default 3â€
looks like utf-8 being misinterpreted as Windows-1252. Try setting the encoding for your pages:
<?php
header( "Content-Type: text/html; charset=utf-8");
or if you prefer in .htaccess file:
AddDefaultCharset UTF-8
Sometimes characters such as ' " , . / \ ; : & % $ # @ *
(basically all symbols) and others are formatted differently if they are copied from another location. Go though and replace all punctuation and other symbols with themselves and those weird characters should go away.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745265041a4619403.html
评论列表(0条)