for example when i retrieve from database the word program's instead of program's what would be shown is program�s. ' and - changes to �. how can i fix this?
The replacement character � (U+FFFD) means that your data is not correctly encoded. You are probably declaring your output as UTF-8 but your database data is not UTF-8 encoded. So you need to convert the data to UTF-8. You can use mb_convert_encoding to do that.
Is your data stored as UTF-8? Try executing these queries before you fetch any data:
SET NAMES utf8
SET CHARACTER SET utf8
Also make sure you're setting your page encoding:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With