i have created a webpage in which data is being inserted in html document using javascript and ajax. I used to display the words like don't it's But when these words are inserted in html div, they are like don�t it�s. Anybody please suggest me how to solve this problem.
Asked
Active
Viewed 67 times
0
-
2Show the code that result's in such improper behavior then only people would be able to answer here. – Jenish Rabadiya Feb 24 '15 at 05:31
-
1Looks like maybe an encoding issue – grimmdude Feb 24 '15 at 05:42
-
1it looks like a similar question has been asked on SO before: http://stackoverflow.com/questions/4086717/why-do-symbols-like-apostrophes-and-hyphens-get-replaced-with-black-diamonds-on – user3647894 Feb 24 '15 at 05:44
-
or use found a link on http://stackoverflow.com/questions/4696499/meta-charset-utf-8-vs-meta-http-equiv-content-type – Oli Soproni B. Feb 24 '15 at 05:49
-
that doesn't solve the problem – Choxx Feb 24 '15 at 05:54
1 Answers
1
The following articles will be useful
http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
After you connect to the database issue the following command:
SET NAMES 'utf8';
Ensure that your web page also uses the UTF-8 encoding:
PHP also offers several function that will be useful for conversions:

hussein shaib
- 108
- 1
- 9