I have a problem with special characters in my database. They now display correct, but sql seems to ignore them in queries. For example, unfortunately I have these entries:
Morgait
Morgaít
Mórgait
Now these names had a UNIQUE key, and while trying to add the second and third after the first one, it would already break saying that the last 2 couldn’t be added since the name would no longer be unique. In short, í gets treated as a normal i, and ó as a normal o.
When I query:
SELECT * FROM member WHERE charname = 'Morgait'
I get all 3 as result. Same for when I change the i to í, o to ó or even both at the same time.
How can I make the database see these differences? I have the collation of the table set to ascii_general_ci (also tried UTF 8 unicode ci).
All of those collations are
accent insensitive. You can tryutf8_binwhich isaccent sensitive, however it’s alsocase sensitive.With accent insensitive collations, for example
éequalseorëand so on.should do the trick. If you need case insensitivity, you can try