From "Crème Brûlée: 10 Tips & Tricks!" to a slug, step by step
A slug has one job: name a page in a way that survives being typed, shared, pasted into a chat and read aloud. That rules out spaces, which become %20, most punctuation, which either means something in a URL or gets encoded, and mixed case, because some servers treat /Recipe and /recipe as different pages. What is left is lower-case letters, digits and one separator.
Here is the title "Crème Brûlée: 10 Tips & Tricks!" going through the generator. First, letters that are their own letter rather than an accented one are spelled out; there are none here. Then the text is split into base letters and accents with Unicode normalisation, and the accents on Latin letters are thrown away, so è and û become e and u. The ampersand becomes the word and. Apostrophes would be removed at this point. The text is lowered: creme brulee: 10 tips and tricks!.
Next, every run of characters that is not a letter or digit becomes a single gap: the colon and space after brulee are one gap, the exclamation mark at the end is dropped. The words are joined with the separator, which gives creme-brulee-10-tips-and-tricks. Type the title above and you will see the same. With a Max length of 20 the slug is cut back to the last whole word that fits: creme-brulee-10-tips, which is exactly 20 characters.
The letters with no accent to strip need a table, because normalisation cannot take them apart. The German ß becomes ss, æ becomes ae, ø becomes o, œ becomes oe, the Polish ł becomes l, đ and ð become d, and þ becomes th. So "L’Œuvre de Łódź" becomes loeuvre-de-lodz. These are the common ones in European languages. A Vietnamese or Turkish title is handled through its accents, which covers most of it, but a rarer letter outside the table is kept as it is rather than guessed at.
Accents are stripped only from Latin letters, and that is a deliberate limit. In Japanese the small mark on ガ is part of the letter: removing it would turn it into カ, a different sound. In Cyrillic, й is not и. So non-Latin text keeps its own letters, and 日本語 ガイド becomes 日本語-ガイド. Modern browsers and search engines handle such URLs well. If your system only accepts ASCII, you will need a proper transliteration for that language, which is a different and much larger job than making a slug.