Skip to content

Unicode/Persian slug navigation issue with Next.js App Router #78

Description

@seyedahmaddev

Bug report

Environment

  • Next.js: 16.1.6
  • Template: next-wp
  • WordPress REST API
  • Language: Persian (UTF-8 slugs)

Description

I'm experiencing an issue when using Persian slugs from WordPress.

The generated links look correct and point to:

/posts/اینترنت-باز-شد-الملل-وصل-شد

However, when I click the link from the post list, Next.js returns a 404 page.

The strange part is that if I remove the slug from the browser address bar and paste the exact same slug again (without changing any characters), the page loads successfully and the post is fetched correctly from WordPress.

So:

  • Clicking the generated <Link> → 404
  • Re-entering the exact same URL manually → Works

What I have already tried

  • trim()
  • Removing zero-width characters (\u200B-\u200D, \uFEFF)
  • dynamicParams = true
  • generateStaticParams()
  • Normalizing the slug before requesting WordPress

None of these solved the issue.

Expected behavior

Client-side navigation should work correctly for Unicode/Persian slugs exactly as it does for ASCII slugs.

Question

Has anyone experienced this issue with Unicode slugs?

Could this be related to URL encoding, Unicode normalization (NFC/NFD), or Next.js App Router handling of non-Latin route parameters?

English slugs work correctly. The problem only happens with Persian (Unicode) slugs

posts/absx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions