php_nub_qq Posted May 19, 2013 Share Posted May 19, 2013 (edited) Hello. I have a rather serious question about collations. All of my fields in all tables are now in utf_bin collation. I recently figured out that I'm going to need case insensitivity in selects and the easiest way I can think of to achieve that is to alter all fields into utf_general_ci. My question is if there is a big difference between those two collations and if yes which is better? Edited May 19, 2013 by php_nub_qq Quote Link to comment https://forums.phpfreaks.com/topic/278188-collations/ Share on other sites More sharing options...
ignace Posted May 20, 2013 Share Posted May 20, 2013 (edited) Yes, there is a big difference. utf8_bin compares string in binary (as in byte-by-byte instead of character-by-character), so sorting may return weird results. Since a and A both have different byte codes, one could say it is case sensitive. utf8_general_ci is case insensitive character-by-character comparison which is probably what you want. More information here: https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-sets.html Edited May 20, 2013 by ignace Quote Link to comment https://forums.phpfreaks.com/topic/278188-collations/#findComment-1431129 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.