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?

Edited by php_nub_qq
Link to comment
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

Edited by ignace
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.