So this has been an on going issue for me. It's an area I don't understand and is really infuriating me.
I have a need to save symbols to a database on one system, then retrieve them and display them on another system.
For example, on the administration system, I have form which allows users to enter a pound £
symbol, but when I output it on one website, it displays � while on another site it displays £
correctly.
I've google, and searched stackoverflow, and this is what I've done:
- Set the database table to utf8_general_ci
- Set the field to utf8_general_ci
- In codeigniter, set the charset to UTF-8
- On the web page which is saving to the database, I have the following:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
which results in the weird character - The pound symbol in the database is successfully a pound symbol.
- The pound symbol on one website is displayed successfully, with the
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
tag in the head - On another website, with the same tag as point 6, it's displaying the weird character still.
- I've added this header to PHP:
header("Content-Type: text/html; charset=utf-8");
and it's codeigniter equivalent. - In the web page displaying the weird characters instead of the £ symbol, the response is:
Content-Type:text/html; charset=utf-8
I don't know what else to do. I've googled, and searched on stackoverflow. All posts say to use the
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
tag, which I have done on each of the site, and non of them are working.
I have also included the
<meta charset="utf-8">
tag which doesn't work.
Please help, I'm at my wits end at trying to understand why it's not working, and nothing that's been suggested is working. If you need any further information, please let me know.
Some resources I've looked at: