Hi all :),
I am having a problem with non UTF-8 characters being stored and read from a database for example as � .
For example
I get � for spaces
when I check the database it’s just a space but when displayed in html it’s � !
especially when � is at the end it does not go away when I trim()
Your problem is that you are not storing as Unicode, or manipulating the string with PHP that is not Unicode aware. Or sending to HTML without sending a proper encoding. I assume it is the later, missing encoding.
Your problem is that you are not storing as Unicode,
that is correct :),
is there a way to detect current encoding and if it’s not utf-8 then to convert ?