Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How can I perform accent-sensitive but case-insensitive utf8 search in mysql? Utf8_bin is case sensitive, and utf8_general_ci is accent insensitive.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
906 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you want to differ "café" from "cafe" You may use :

Select word from table_words WHERE Hex(word) LIKE Hex("café");

This way it will return 'café'.

Otherwise if you use :

Select word from table_words WHERE Hex(word) LIKE Hex("cafe");

it will return café. I'm using the latin1_german2_ci Collation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...