Last active
November 21, 2021 16:17
-
-
Save Bronskiy/fa9534bc8e2bbcb082e2227817bafc41 to your computer and use it in GitHub Desktop.
MySQL to convert cyrillic string(Russian Alphabet) into a slug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(LOWER(TRIM('My String')), 'а', 'a'), 'б', 'b'), 'в', 'v'), 'г', 'g'), 'д', 'd'), 'е', 'e'), 'ё', 'e'), 'ж', 'j'), 'з', 'z'), 'и', 'i'), 'й', 'j'), 'к', 'k'), 'л', 'l'), 'м', 'm'), 'н', 'n'), 'о', 'o'), 'п', 'p'), 'р', 'r'), 'с', 's'), 'т', 't'), 'у', 'u'), 'ф', 'f'), 'х', 'h'), 'ц', 'c'), 'ч', 'ch'), 'ш', 'sh'), 'щ', 'sht'), 'ъ', 'y'), 'ы', 'i'), 'э', 'e'), 'ь', 'i'), 'ю', 'u'), 'я', 'ja') AS `post_name` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment