Hi,
I’ve been using mysql databases for some time. However, I haven’t really bothered with details such as character sets (which I hardly know anything about anyway...). Now I’d like to make sure things are done properly... This is the story so far;
I’ve got a website where most text is pulled from a mysql database. Things look fine when specifying
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
in my webpages. Also, adding data to the database using a form on one of my webpages works fine, as the text displays correctly on the pages after being pulled from that same database. However, not everything is perfect…
If I add the characters "åäö" to the database via phpmyadmin, then it is displayed as "???" on the webpage. If I add the characters åäö to the database via my own form on one of my webpages, then it looks fine on the website, but it is displayed as "åäÃ" when viewing it in phpmyadmin.
Clearly I need to change something, but what? The only info I find in phpmyadmin regarding character sets is that COLLATION is set to utf8_unicode_ci for my table and that all the text fields in my table has COLLATION set to latin1_swedish_ci. Should both table and fields be set to the same? Are there some other changes to make? Do I need to do any nasty conversions?
Please let me know if you need any further info...
I’ve been using mysql databases for some time. However, I haven’t really bothered with details such as character sets (which I hardly know anything about anyway...). Now I’d like to make sure things are done properly... This is the story so far;
I’ve got a website where most text is pulled from a mysql database. Things look fine when specifying
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
in my webpages. Also, adding data to the database using a form on one of my webpages works fine, as the text displays correctly on the pages after being pulled from that same database. However, not everything is perfect…
If I add the characters "åäö" to the database via phpmyadmin, then it is displayed as "???" on the webpage. If I add the characters åäö to the database via my own form on one of my webpages, then it looks fine on the website, but it is displayed as "åäÃ" when viewing it in phpmyadmin.
Clearly I need to change something, but what? The only info I find in phpmyadmin regarding character sets is that COLLATION is set to utf8_unicode_ci for my table and that all the text fields in my table has COLLATION set to latin1_swedish_ci. Should both table and fields be set to the same? Are there some other changes to make? Do I need to do any nasty conversions?
Please let me know if you need any further info...