Reputation: 19431
I'd like to generate URL slugs from content titles automatically when I put them into the database. So I'd like make accented characters unaccented.
I tried to use CONVERT(title USING ascii)
, but it replaces accented characters with ?
s.
MySQL already uses collation tables to match strings like this one.
Is it possible to use the collation to replace characters with their collation group character?
Upvotes: 1
Views: 742
Reputation: 51868
A collation is a set of rules that determine how data is sorted and compared. What you mean is character set. But since there are no rules defined which character corresponds to which character in a set with fewer characters, this is not possible by simply converting to another character set. You would have to write a function, that translates each character to the one without accent. The table you posted would be quite useful with this.
Upvotes: 1