Implement Vietnamese Collation in MySQL

MySQL has yet to integrate support for Vietnamese Collation (Bug #4745). You can, in the meantime, add the missing collation simply by replacing the Index.xml file in <MySQL Server 5.x>\share\charsets directory with this Index.xml, which implements the Vietnamese collation for both utf8 and ucs2 charsets. As a result, you will have native support for both sort and compare operations in MySQL 5.x Community Server.

With the new collation, you can run the query as follows, assuming your table has a column with one character of the Vietnamese alphabetical set in each row:

SELECT letter FROM letters WHERE letter='a' COLLATE utf8_vietnamese1_ci;
would return 'a', 'à', 'ả', 'ã', 'á', 'ạ', and their capitals. The same result would also be returned for any diacritical variation of the character 'a' in the WHERE clause.

On the other hand, the query

SELECT letter FROM letters WHERE letter='a' COLLATE utf8_vietnamese2_ci;
would return only 'a' and 'A'.