0

I tried utf8_bin

I have a value "AAAA"

I tried to add value "Aaaa" and got a duplicate key violation.

But I thought binary would differentiate between upper and lower case.

Buttle Butkus
  • 9,206
  • 13
  • 79
  • 120
  • `uf8_bin` _should_ be case-sensitive. http://stackoverflow.com/questions/4558707/case-sensitive-collation-in-mysql – Matt Ball Dec 10 '12 at 04:28
  • What happened to `utf8_unicode_cs`? You realized it doesn't exist and deleted your answer? I still want it! Well it turns out that utf8_bin works, as long as the column is encoded as such. I changed the table encoding to utf8_bin, but that didn't affect the column encoding. Once I changed the column encoding, it worked. Now I just use COLLATE utf8_general_ci when I want a case-insensitive search. I guess I should just delete this question. What do you think? – Buttle Butkus Dec 10 '12 at 06:05
  • Maybe you should rethink your whole design? Relying on case sensitivity...I don't know, man... – fancyPants Dec 10 '12 at 08:29
  • Yes, I realized there is no `utf8_unicode_cs` collation. Yes, you should probably just delete this question. – Matt Ball Dec 10 '12 at 14:59
  • @tombom This is for fixing string values. I need to be able to store correct and incorrect versions. E.g. "FBI" is correct, "fbi" is incorrect. "Washington" is correct, "washington" is incorrect. So the table needs to differentiate between values that would be identical with `ci`, so that it can convert from wrong values to right ones. – Buttle Butkus Dec 11 '12 at 09:19
  • Possible duplicate of [Case Sensitive collation in MySQL](https://stackoverflow.com/questions/4558707/case-sensitive-collation-in-mysql) – Jared Beck Sep 18 '17 at 15:57

0 Answers0