Bug #61258 Cannot search char 'Đ' via the word 'd'
Submitted: 22 May 2011 19:26 Modified: 23 May 2011 21:20
Reporter: Tung Nguyen Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.5.8 OS:Any (CentOS)
Assigned to: CPU Architecture:Any
Tags: search utf8, special character

[22 May 2011 19:26] Tung Nguyen
Description:
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $
PHP extension: mysql

I got the problem with SELECT special character like 'Đ'. My database in Vietnamese, it's contain some special character like ê, Ê, Á, ă, â, đ, Đ, á,.. I can search 'ê', 'Ê' => 'e' ; Ă,á,â... => 'a'. But it isn't work with character 'Đ', 'đ' => 'd'

How to repeat:
For example: 'Nhớ Về Ngày Ấy' => 'nho ve ngay ay'

For example:
'Người Lạ Nơi Cuối Con Đường'
=> 'nguoi la noi cuoi con' [it's OK]
=> 'nguoi la noi cuoi con duong' [ít cannot find the records when i search with 'd' for 'Đ']

I hope you fix this soon.

Suggested fix:
recognize characters 'đ', 'Đ' such as d, D
[23 May 2011 3:33] Alexey Kishkin
Hi Tung Nguyen,

Which collation do you use for your search column?
[23 May 2011 5:32] Tung Nguyen
Hi Alexey Kishkin,

I use utf8, the same charset with database, table, column. Everything is ok, but only the words contain character 'đ', 'Đ' (If i include character 'd' or 'D' in the search query, it return 0 results.

I think you should insert some Vietnamese records and try a search, it's very clearly:

id  title
1 Anh đã làm gì sai
2 Buồn bã về nhà
3 Đừng nói thế về nhà mày
4 Người Lạ nơi cuối con đường
5 Bọn nó thật tội nghiệp

for example:
i can search for '%ve nha%' => return id = 2,3
'%nguoi la noi%' => return id = 4
'%nguoi la noi cuoi con duong%' or '%cuoi con duong%' => return 0 result, // it must show id = 4
'%noi the%' => return id = 3
'%dung noi the%' => no result // it must show id = 3

Sorry about my bad English, i hope you can understand my case.
[23 May 2011 13:59] Peter Gulutzan
This looks like a duplicate of the feature request
Bug#4745 Add Vietnamese collation for the ucs2
and utf8 Unicode character sets. If one uses MySQL
5.6 with Vietnamese collation, then 'D' = 'Đ'.
[23 May 2011 14:03] Valeriy Kravchuk
Duplicate of Bug#4745.
[23 May 2011 21:20] Tung Nguyen
Hi,

It's fortunately for me that you have recently fixed that issue at version 5.6.0

Thanks for your support!
[5 Aug 2011 3:33] Lam Dinh Ha Ly
This case is very usefull. Thanks Tung Nguyen and MySQL development community.
[3 Jul 2014 20:31] Nguoi Nha Que
Hello All,

I would like to know how MySQL 5.6 supports this problem. 
I have a schema with utf8_vietnamese_ci as collation and 'd' is not matching 'đ', e.g. 'dong' does NOT match 'đồng'. I have tried different collations, but nothing seems to work. Also SELECT 'd' = 'đ' COLLATE utf8_vietnamese_ci will return 0, which means đ and d are not matching.

Please inform me what is the solution. Many thanks.