EmilTholin / svelte-routing

A declarative Svelte routing library with SSR support
MIT License
2.04k stars 183 forks source link

Cyrillic characters in path #167

Open kyuru opened 4 years ago

kyuru commented 4 years ago

Hello! Routing with Cyrillic characters in the path does not work. For example: example.ru/пример-страницы

<Router {url}>
    <nav>
        <NavLink to="/пример-страницы">
            Пример страницы
        </NavLink>
    </nav>
    <Route path="/пример-страницы" component={Example} />
</Router>

Can you please tell me if this can be fixed?

EmilTholin commented 3 years ago

Hi @kyuru!

That's unfortunate. I can't say exactly why this is, but I will look into it and get back to you on if it can be solved or not.

Gullesnuffs commented 3 years ago

I realize this issue is old but I just encountered the same problem and figured I would write about the workaround I used.

To make it work, you need to escape the Cyrillic characters. For example, instead of <Route path="/п" component={Example} /> you'd write <Route path="/%D0%BF" component={Example} />.