murattunalı.

Turkish characters and URL slugs.

Turkish characters can technically be used in the address bar, but since in practice they become unreadable once encoded, simplified slugs are preferred.

Using Turkish characters in the address bar is technically possible today: browsers display them and search engines understand them. But when copied and pasted, the address turns into a long percent-signed sequence and becomes unreadable.

That directly affects sharing: an address shared in a message or document looks unintelligible, and some systems break encoded addresses. The practical consequence is simplifying the Turkish characters.

The simplification rules

The conversion is not as simple as it looks, because two letters demand special care.

  1. ç → c, ğ → g, ş → s, ü → u, ö → o — the straight counterparts.
  2. ı → i and i → i — Turkish’s dotted and dotless i collapse into one letter.
  3. İ → i — the uppercase dotted I becomes the lowercase dotted i.
  4. I → i — the uppercase dotless I also becomes the lowercase dotted i. Outside Turkish this would be wrong.
  5. Space → hyphen — not the underscore; the hyphen counts as a word separator.
  6. Punctuation is deleted — the one exception is the hyphen.

The second and fourth items are the trap specific to Turkish: most programming languages’ default case conversion does not know the Turkish rules and turns the uppercase I into a dotted i — which in Turkish is wrong. A language-aware conversion must be used when simplifying.

The same trap exists in sorting operations: if alphabetical sorting is not done by the Turkish alphabet, letters like ç, ğ and ş fall into the wrong place. On pages carrying alphabetical lists, such as a glossary, that produces a visible defect.

The slug must be permanent

Changing a slug after it is published produces a debt: the old address is recorded somewhere, and that address no longer works. Even with a redirect in place there is a loss, and the chain accumulates over time.

The slug decision should therefore be made BEFORE publication and chosen as permanently as possible. A practical rule: let the slug say what the content is, not when it was written — slugs containing dates go stale when the content is updated.

The second rule: keep the slug short and single-topic. Long slugs are neither read nor survive line breaks intact. Three to five words is a practical range.

The slug should say what the content is, not when it was written.

Automating the conversion

When slug production is done by hand, inconsistency is inevitable: a hyphen on one page, an underscore on another; uppercase here, lowercase there. The durable solution is binding the conversion to a function and passing every slug through it.

The function needs to know Turkish, and the default tools do not provide that. Most languages’ standard lowercasing function does not apply the Turkish rules — it turns the uppercase dotless I into a dotted i, which in Turkish is wrong. A language-aware conversion or a hand-written mapping table is needed.

  1. Pass everything through one function — let every slug be produced by the same rules.
  2. Define the Turkish letter mapping by hand — do not trust the default conversion.
  3. Make the separator the hyphen — the underscore does not count as a word separator.
  4. Lowercase it — addresses can be case-sensitive.
  5. Collapse consecutive hyphens — deleting punctuation can leave double hyphens.
  6. Trim hyphens at the start and end.

On this site the slugs are written by hand in the content files, but their format is uniform: lowercase, hyphen-separated, Turkish characters simplified. The rules are written in the content contract and every new file follows them.

And a permanence rule: a published slug is not changed. If it must change, a redirect is set up from the old address to the new one, and that redirect is permanent — because the old address stays recorded somewhere, and those records are never cleaned.

Internationalized domain names

The slug-side decision surfaces once more on the domain side: can Turkish characters be used in the domain name itself? Technically yes — internationalized domain names make it possible.

But the same readability problem is harsher here: when the domain is encoded it turns into a meaningless string and causes trouble in e-mail addresses, printed material and word of mouth. Saying “dot com” is easy; describing an encoded domain name on the phone is not.

There is a security dimension too: characters that look alike across alphabets can be used to produce imitation domains. Browsers therefore show the encoded form in some cases, and the domain looks meaningless to the user.

The practical advice: do not use Turkish characters in the domain name. A simplified domain works everywhere, reads everywhere and looks the same everywhere. This site’s domain name is like that too.

A limit to close: simplification produces information loss, and that is an accepted trade-off. “Şişli” and “sisli” look the same in a slug and cannot be told apart. A rare case, but where a collision is possible the slug should be disambiguated by hand — the automatic conversion should not be trusted blindly.

One more rule: slug production should be done once and written into the content file, not recomputed on every render. If the conversion function changes one day — a letter mapping is corrected — the recomputed slugs change too, and all the addresses break.

When the slug is produced once and fixed, that risk disappears: even if the function changes, the published addresses do not. On this site the slugs are hand-written in the content files and counted immutable.

A practice to close: when deciding a slug, ask whether that slug will still be right a year later. When the content is rewritten, the service renamed or the scope widened, the slug goes stale — and a stale slug means living with a redirect debt.

A final check: all published slugs should be scanned once and their format consistency verified. If a slug contains uppercase, an underscore, a double hyphen or an encoded character, it was probably written by hand and never passed through the conversion. The scan takes a few lines of script and covers the whole site in one pass.

SOURCES