I'm a web developer of 15 years and this problem never fails to cause me issues and there are 1000's of similar questions posted on this topic but I still can't find a definitive answer.
I'm trying to store a '¼' symbol in a MySQL database table. The table stucture is as follows:
CREATE TABLE `denominations` (
`id` int(11) NOT NULL,
`title` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
My page which renders the results:
The pages themselves are saved in the UTF-8 page settings with my editor. Despite this the symbol displays as a black diamond with a question mark.
The server I am running on is a local WAMP installation, my PHP.ini settings has:
default_charset = "UTF-8"
This is an age old problem that is exhausting and boring for us all, but yet again it has beat me. What am I doing wrong?
EDIT 1
The rendered output:
var_dump($denominations);
array (size=18)
1 => string '�' (length=1)
2 => string '1d' (length=2)
3 => string '1' (length=1)