🏡

Case Sensitivity Help

Content branch : Feed >> Type : server Homehelp ⛱ascii ⛱ case-sensitivity
This page /help/ascii/case-sensitivity recently updated November 23, 2025, 8:18 am 2 weeks ago.
Home Ascii .. Sign Up 🖶
Case Sensitivity Help
  1. Check your database collations : maria DB resources
collations ending in _ci are case insensitive, whereas collations ending in _cs are case sensitive. Eg latin1_general_cs

Case Sensitive Collations

CollationCharsetIdDefaultCompiledSortlen
latin1_general_cslatin149Yes1
latin2_czech_cslatin22Yes4
cp1250_czech_cscp125034Yes2
latin7_estonian_cslatin720Yes1
latin7_general_cslatin742Yes1
cp1251_general_cscp125152Yes1


In general, utf8_general_ci is faster than utf8_unicode_ci, but less correct. Note: utf8 is not an old form of utf16 but rather utf16 was the original. So, use utf8

For any Unicode character set, operations performed using the _general_ci collation are faster than those for the _unicode_ci collation. For example, comparisons for the utf8_general_ci collation are faster, but slightly less correct, than comparisons for utf8_unicode_ci. The reason for this is that utf8_unicode_ci supports mappings such as expansions; that is, when one character compares as equal to combinations of other characters. For example, in German and some other languages “ß” is equal to “ss”. utf8_unicode_ci also supports contractions and ignorable characters. utf8_general_ci is a legacy collation that does not support expansions, contractions, or ignorable characters. It can make only one-to-one comparisons between characters.

Apparently there are no utf8_*_cs in MySQL (yet). If you need case sensitive collation for utf8 fields, you should use utf8_bin. This will mess up ORDER BY, but this can be fixed by ORDER BY column COLLATE utf8_general_ci
Ascii ..