Jump to content

Collations


php_nub_qq

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/278188-collations/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/278188-collations/#findComment-1431129
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.