Skip to content

Instantly share code, notes, and snippets.

@Bronskiy
Last active November 21, 2021 16:17
Show Gist options
  • Save Bronskiy/fa9534bc8e2bbcb082e2227817bafc41 to your computer and use it in GitHub Desktop.
Save Bronskiy/fa9534bc8e2bbcb082e2227817bafc41 to your computer and use it in GitHub Desktop.
MySQL to convert cyrillic string(Russian Alphabet) into a slug
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