Difference between utf8mb4_unicode_ci and utf8mb4_unicode_520_ci collations in MariaDB/MySQL?

后端 未结 3 756
说谎
说谎 2020-12-09 01:48

I logged into MariaDB/MySQL and entered:

SHOW COLLATION;

I see utf8mb4_unicode_ci and utf8mb4_unicode_520_ci amon

3条回答
  •  甜味超标
    2020-12-09 02:35

    I will develop @StuiterSlurf answer and focus on details of utf8mb4_unicode_ci/utf8mb4_unicode_520_ci:

    As you can read here (Peter Gulutzan) there is problem with sorting/comparing polish letter "Ł" (L with stroke) (lower case: "ł"; html esc: ł and Ł ) - we have following assumption in coding (same with mb4):

    utf8_polish_ci      Ł greater than L and less than M
    utf8_unicode_ci     Ł greater than L and less than M
    utf8_unicode_520_ci Ł equal to L
    utf8_general_ci     Ł greater than Z
    

    In polish language letter Ł is after letter L and before M. And for different coding system you will get different sorting results. No one of this coding is better or worse - it depends of your needs.

提交回复
热议问题