Hello All While i print a query from wordpress to my site it shows weird characters Something like: What�s With the Cutbacks? The original form is What’s With the Cutbacks? Im not sure why its happening like this. Can anybody pls tell me why its happening and how to resolve it. All helps would be greatly appreciated. Thanks
You used a ' from Word or some other word processor so UTF replaces it with that char. Always paste your text to something like notepad2 and replace all " ' with that charset before you insert it into a database or a UTF text page.
Im facing the problem after retrieving the data from database. But the same text is showing well in phpMyAdmin, not in my page. My title is something like this : "What's... " its not able to show ' in my page, rest of the places its shows well. Im wondering if thr is anything wrong with my page??....
You are right, but How to avoid the character misprinting if user enters the details by copying from word? Is ther any way out for that?
I imagine it can be done but it must not be real easy else I would not see so many posts here at DP with those blocks in the titles. As speculation only since the topic is more advanced than my PHP skills, I would assume you could sanitize the input using some character replacement feature of PHP.
Using UTF-8 would be a nice idea in order to avoid those characters to appear. Remember you have to do the following: - Your server need to have in you httpd.conf apache file: AddDefaultCharset UTF-8 (if you use apache), - Your webpages headers need to have a META tag defined with charset=UTF-8, - Finally, your webpage files need to be saved with an editor that will allow you to change the file encoding to UTF-8. Eclipse allows you to do this perfectly. Only after meeting those 3 requirements, your pages will show you data with the right special characters.
I understood first 2 options, Can you pls give me some basic idea for the 3rd option that is "Finally, your webpage files need to be saved with an editor that will allow you to change the file encoding to UTF-8. Eclipse allows you to do this perfectly." Thanks a lot for the good efforts.