MySQL DB selects records with and without umlauts. e.g: '.. where something = FÖÖ'

前端 未结 3 1544
栀梦
栀梦 2020-12-19 06:22

My Table collation is \"utf8_general_ci\". If i run a query like:

SELECT * FROM mytable WHERE myfield = \"FÖÖ\"

i get results where:

<
3条回答
  •  我在风中等你
    2020-12-19 07:04

    A list of the collations offered by MySQL for Unicode character sets can be found here:

    http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html

    If you want to go all-out and require strings to be absolutely identical in order to test as equal, you can use utf8_bin (the binary collation). Otherwise, you may need to do some experimentation with the different collations on offer.

提交回复
热议问题