How to create a unique case-insensitive Mysql case with accentuation - (or use NO sorting)

I'm fighting sortings. I want to build a table with a unique word index, which is case insensitive but different from "a" "a". This means that "de" and "dé" must be 2 different entries, but de, De, DE, dE must be the same.

Is there a utf8 build that does the job (it doesn't seem to be that way)? Is there any way to tell mysql not to use any mappings? Is there any other solution? I do not want to change my words to lower or upper case

thank

+3
source share
1 answer
  • utf8, (, , )?

    , MySQL, : utf8_*_ci , utf8_bin .

  • mysql ?

    ( ); , (, BINARY), .

    , - ( !). utf8_bin, (, , ).

  • - ?

    UPPER() LOWER(), ( , ), utf8_bin . , , ( , ) . :

    SELECT col FROM my_table WHERE UPPER(col) LIKE UPPER('de') COLLATE utf8_bin
    

    sqlfiddle.

    , ( MySQL) utf8_unicode_ci, - ( , -, , ).

+5

All Articles