I have a table a MySQL Table
CREATE TABLE `mytable` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`urlpt` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Case sensitivity matters.',
PRIMARY KEY (`id`),
UNIQUE KEY `urlpt_UNIQUE` (`urlpt`),
KEY `urlpt_INDEX` (`urlpt`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
and I was wondering if I have to set the column urlpt as binary, because I do use utf8_bin collation. (I want to handle e.g. a and á and â and so on as different characters…)
No you don’t have to. If the data really is UTF-8, then storing it as a UTF-8 VARCHAR as you’ve done is fine.
And you use the collation to tell MySQL how things should be sorted/compared – as you’ve done.
Have you actually had a problem?