CREATE TABLE `post` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(750) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(750) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `post_slug_unique` (`slug`),
) ENGINE=InnoDB AUTO_INCREMENT=317940 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
What CHARSET/COLLATE
I should use to store/search non-English characters instead of utf8mb4_unicode_ci
in mysql?
This answer had satisfactory explanation and reasoning to use What's the difference between utf8_general_ci and utf8_unicode_ci?
But I am unable to know and fix, why following simple Query: q1 giving my undesired result
select slug from post where slug like '%آ%' order by id limit 1;
Result: گورنر-چودھری-محمد-سرور-کی-چودھری-برادران-سے-ملاقات-سیاسی-اور-حکومتی-اُمور-پر-گفتگو
I expected the result to be empty (no rows) with q1 and above result should only be obtained by following query:q2
select slug from post where slug like '%اُ%' order by id limit 1;
Diagnosis: I tried a hit and trial diagnosis and found following
select ASCII('آ'); => 216
Also
select ASCII('اُ'); => 216
So here I am stuck , apparently they are not same characters but giving me same character code. So Mysql is giving the results rightfully, but what different charset I can use to store my data so I can I get my desired result (Empty => no rows) from given Query:q1.