Check 27.04 · Development and accessibility by language

Handle accents and non-Latin scripts

Handle accents, Cyrillic, Arabic or Chinese in URLs, slugs, redirects, site search and capitalization on Apache, Nginx, Cloudflare, WordPress or Laravel.

Priority
Important
Difficulty
Intermediate
Estimated time
2 h to 2 days
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

A site that publishes in French, German, Polish, Russian or Japanese handles characters outside ASCII: accented letters, ß, ł, the Cyrillic, Greek and Arabic scripts, ideographs. The task is to decide how these characters appear in URLs, to encode them correctly in links, sitemaps and redirects, to prevent the same character from existing in two Unicode forms, and to check that site search and formatting handle them properly. Once it is done, every page has a single, stable URL in each language, and no character breaks a link, a redirect or the display.

Why it matters

URLs only accept ASCII. A character such as “ü” or “杂” is transmitted percent-encoded from its UTF-8 bytes: gemüse becomes gem%C3%BCse. Google documents this in its URL structure guidelines: non-ASCII characters must be percent-encoded in links, with examples in German, Arabic and Chinese. The browser displays the readable form, but technical files (links, canonical, hreflang, sitemaps) must carry the encoded form.

The same text can have several encodings. In Unicode, “é” exists as a precomposed character (NFC form) or as “e” followed by a combining accent (NFD form). Both look identical but produce two different URLs: %C3%A9 and e%CC%81. macOS readily produces the second form in file names. Add the case of encoded sequences (%c3%a9 or %C3%A9) and the choice between “ete” and “été”: without a rule, a multilingual site manufactures duplicates and broken links.

The rest of the chain must follow. A redirect written with the wrong form does not fire, an accent-sensitive site search does not find “ete” when the visitor types without accents, and CSS capitalization ignores the language's rules if the lang attribute is missing: the Turkish i becomes I instead of İ.

Prerequisite: a site entirely in UTF-8, see use UTF-8 (opens in a new tab).

What it improves

  • Indexing A single URL per page and per language, with no duplicates caused by encoding variants.
  • Links and redirects No more 404s on accented URLs after a migration or a share.
  • Click-through rate URLs that are readable in the visitor's language are shown in results. A plausible effect, not measured by the search engines.
  • Site search and conversion Visitors find products with or without accents.
  • Rendering Capitalization, sorting and text comparison that follow each language's rules.

How to check

List the URLs in a sitemap that contain encoded characters, then look for decomposed forms and lowercase sequences:

curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*%[^<]*</loc>' | head -n 20
curl -s https://example.com/sitemap.xml | grep -c -E '%CC%8[0-9A-F]|%cc%8[0-9a-f]'
curl -s https://example.com/sitemap.xml | grep -c -E '%([0-9][a-f]|[a-f][0-9a-f])'

The second command counts combining accents (NFD form); the third, lowercase sequences. Both must be 0 if your rule is NFC and uppercase.

Check that two forms of a URL do not both respond with 200:

curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/de/gem%C3%BCse/"
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/de/gemu%CC%88se/"
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/de/gemuse/"

Expected: the official form returns 200, the others a 301 to it or a 404.

Other checks:

  • Screaming Frog: URL tab, “Non ASCII Characters” filter, then compare with the chosen rule.
  • Search Console: Pages report, “Duplicate without user-selected canonical” reason and 404s on accented URLs.
  • Site search: type a word without accents (“ete”, “muller”) and check that it finds “été”, “Müller”.
  • Capitalization: on a Turkish or Greek page, look at a heading capitalized by CSS.

How to implement

Before you start

Choose a slug rule for each language and apply it everywhere:

Language Option A: native characters Option B: transliteration Common practice
French, Spanish, Italian /été-à-paris/ /ete-a-paris/ Option B, easier to share
German /gemüse/ /gemuese/ (ü becomes ue) Both exist
Polish, Czech /łódź/ /lodz/ Option B is common
Russian, Greek, Ukrainian /овощи/ /ovoshchi/ Both exist
Arabic, Chinese, Japanese /薄荷/ Transliteration hard for speakers to read Option A or an English slug

Google accepts both options; readability for the visitor decides. See translate slugs if relevant (opens in a new tab) and translate slugs (opens in a new tab).

Set three technical rules:

  1. NFC normalization of any text used to build a URL or a file name.
  2. Uppercase percent-encoding in links, canonical, hreflang and sitemaps: gem%C3%BCse.
  3. ASCII media file names (gemuse-bio.webp): they are immune to differences between systems.

In JavaScript and PHP:

const slug = title
  .normalize('NFD')
  .replace(/\p{Diacritic}/gu, '')
  .toLowerCase()
  .replace(/[^a-z0-9]+/g, '-')
  .replace(/^-|-$/g, '')
$text = Normalizer::normalize($text, Normalizer::FORM_C);

The first example produces an ASCII slug for Latin-script languages (option B); it empties a Cyrillic or Chinese title, which needs a dedicated transliteration or option A. The Normalizer class requires the PHP intl extension.

In sitemaps, also escape XML special characters: & becomes &amp;. The protocol requires a UTF-8 file.

For internationalized domain names (müller.de), DNS uses the Punycode form (xn--mller-kva.de). Keep a single form in your canonical, hreflang and sitemaps, and check that the other one redirects if it is served.

Apache

Versions Apache 2.4.

mod_rewrite matches the pattern against the already decoded path: you can write the character itself in the rule, provided the file is saved in UTF-8. For the target, write the encoded form and add the NE flag, otherwise Apache re-encodes the % and produces %25C3%25BC:

RewriteEngine On

RewriteRule ^de/gemüse/?$ /de/gemuese/ [R=301,NE,L]
RewriteRule ^ru/овощи/?$ /ru/ovoshchi/ [R=301,NE,L]
RewriteRule ^de/obst-und-gemüse/?$ /de/obst-und-gem%C3%BCse-bio/ [R=301,NE,L]

In the virtual host rather than .htaccess, prefix the patterns with /. sudo apachectl configtest && sudo systemctl reload apache2, then test with curl.

Nginx

Versions Nginx 1.18 and later.

Nginx matches location blocks against the normalized URI, after decoding %XX sequences. Write the character in the pattern and the encoded form in the target:

location = /de/gemüse/ {
    return 301 /de/gemuese/;
}

location = /ru/овощи/ {
    return 301 /ru/ovoshchi/;
}

For a large number of redirects, use a map on $uri (decoded) in the http context. The $request_uri variable, on the other hand, contains the raw encoded form. sudo nginx -t && sudo systemctl reload nginx.

Cloudflare

Versions Cloudflare dashboard, all plans, November 2026.

When incoming URL normalization is enabled, Cloudflare applies RFC 3986: encoded sequences are uppercased and non-ASCII characters are encoded. In a redirect rule (Rules > Overview, “Redirect Rules”), compare the path with the uppercase encoded form:

(http.request.uri.path eq "/de/gem%C3%BCse/")

Static target: https://example.com/de/gemuese/, status code 301. The normalization settings are in Rules > Settings.

WordPress

Versions WordPress 6.4 and later; Polylang 3, WPML 4 and 5.

On save, WordPress generates the slug with sanitize_title(): Latin accents are removed by remove_accents() (“été” becomes ete), with rules specific to some languages, such as ae for ä when the site is in German. Cyrillic, Greek, Arabic or Chinese characters are kept and percent-encoded in the slug.

  • To transliterate Cyrillic into Latin, a transliteration plugin is required; install it before publishing, as it does not always change existing slugs.
  • With Polylang or WPML, each translation has its own slug: edit it in the “Slug” field of the post panel.
  • After changing a slug, add a 301 redirect (Yoast SEO Premium, Rank Math or the Apache and Nginx sections).
  • Rename media files to ASCII before uploading them from a Mac.

Shopify

Versions Shopify admin, all plans, Translate & Adapt app, November 2026.

Shopify generates the handle (the final part of the URL) from the title. Check and edit it in the search engine listing section of each product, collection or page (“Edit” link), ticking the option to create a URL redirect when you change an existing handle. With several languages, the translated handle is edited in the Translate & Adapt app or your translation app.

Laravel

Versions Laravel 11 to 13.

Str::slug() transliterates to ASCII; its third parameter selects the language rules:

use Illuminate\Support\Str;

Str::slug('Été à Paris');
// ete-a-paris

Str::slug('Gemüse und Obst', '-', 'de');
// gemuese-und-obst

Str::slug('Свежие овощи', '-', 'ru');
// slug in Latin characters, following Russian rules

For search, use an accent-insensitive collation (utf8mb4_unicode_ci or utf8mb4_0900_ai_ci): WHERE name LIKE '%muller%' then finds “Müller”. In PHP, compare and sort with Collator from the intl extension (new Collator('de_DE')), not with strcmp().

Next.js

Versions Next.js 15.5 and 16 (App Router).

Dynamic segments may arrive encoded in params, depending on the version and the environment. Decode them before querying the database:

export default async function Page({ params }: PageProps<'/[lang]/[slug]'>) {
  const { lang, slug } = await params
  const decodedSlug = decodeURIComponent(slug).normalize('NFC')
  // look up the content with decodedSlug and lang
}

Test an accented URL locally and after deployment. In generateStaticParams, return the slugs in readable form and check in the build folder that the generated pages match the encoded URLs. To compare or sort strings, use Intl.Collator with the page's language.

Common mistakes

  • NFC and NFD duplicates: the same page responds at %C3%A9 and e%CC%81, often because of a file name coming from a Mac.
  • Double encoding: %25C3%25A9 in an Apache redirect without the NE flag, or in a sitemap encoded twice.
  • Slug changed without a redirect: the old accented URL returns a 404.
  • Different rules by language or template: transliterated products and accented articles on the same site.
  • Accents removed from the text instead of just the slug: titles and H1s written “Ete a Paris” to match the URL.
  • Accent-sensitive site search: a binary collation (utf8mb4_bin) that does not find “ete”.
  • text-transform: uppercase without lang: wrong capitals in Turkish, Greek or German.

Frequently asked questions

Should you keep accents in URLs?

Both choices work: Google accepts URLs with accented characters, percent-encoded in the code. Transliteration (été becomes ete) gives shorter links that are easier to share; accents give URLs that are more readable in the browser. What matters is choosing one rule per language, applying it to every template and redirecting any other form to the official one with a 301.

Do Cyrillic or Chinese URLs rank well?

Yes. Google documents examples of URLs in Arabic and Chinese and only recommends percent-encoding them in links and technical files. The browser then displays the readable form. The drawback is practical: copied into an email or a social network, these URLs often appear as long strings of %D0%BE. For this reason, some sites prefer a transliteration or an English slug.

Why does an accented URL return a 404 when the page exists?

Most often, the requested URL and the stored URL use two different Unicode forms of the same character: precomposed é on one side, e followed by a combining accent on the other. This is common with file names created on macOS. Other causes: double encoding in a redirect, or a rule written with the wrong case for the %XX sequences. Normalize to NFC and test each form with curl.

How do you make site search accent-insensitive?

Use an accent-insensitive database collation, such as utf8mb4_unicode_ci or utf8mb4_0900_ai_ci in MySQL: a search for muller then finds Müller. In the application, compare strings with Intl.Collator in JavaScript or Collator in PHP, set to the page's language. A dedicated search engine usually offers an equivalent setting, to be checked for each published language.

Updated on

Topic checklist (PDF)

And now?

In the “Development and accessibility by language” topic

  1. Set html lang on each page
  2. Mark passages in another language
  3. Use UTF-8
  4. Handle accents and non-Latin scripts
  5. Handle dir=rtl if needed
  6. Check fonts for each language
  7. Test for text overflow
  8. Test performance for each version
  9. Test SSR/SSG for all languages
  10. Test multilingual dynamic routes
  11. Check per-language cache handling
  12. Check the CDN and language variants
  13. Serve the right content at the requested URL
  14. Test without cookies
  15. Test without Accept-Language
  16. Test keyboard navigation of the language switcher