Disclaimer:
- Database is
ut8mb4_unicode_520_ci
- Table field is
ut8mb4_unicode_520_ci
How do you correctly query a table field that contains dakuten or handakuten Japanese characters? Dakuten.
Currently, it seems that the base character is returned, even when the query is ran for the tenten version.
Example Data
Given へ
and ぺ
.
And a row with ID: 199, post_title: 'へ';
Scenario 1
Run:
SELECT 'へ' = 'ぺ';
-- Returns 0. Correct
Scenario 2
Run:
SELECT ID, post_title
FROM wp_posts
WHERE post_title = 'へ';
-- Returns row 199. Correct
Scenario 3
But, for some reason, when I run this query, it still returns record 199, noting the different title value.
Run:
SELECT ID, post_title
FROM wp_posts
WHERE post_title = 'ぺ';
-- Returns row 199. Incorrect
Example Image
An image would explain better (I'm just using union to better diplay everything in one screenshot):
Is there a solid approach to working with these characters? All other Japanese characters seem to work fine, its just the dakuten versions are treated like their bases in queries only.