preact-router icon indicating copy to clipboard operation
preact-router copied to clipboard

Unicode routes

Open NicolaiSchmid opened this issue 6 years ago • 0 comments

I have a route which contains a ISO 8859-2 character /über. When I'm on the page and using a <Link href="/über" /> it routes fine and the url state of the <Router />-component is set to /über.

But if I refresh the page on the /über route, the url-state is urlencoded and set to /%C3%BCber. Setting the path prop on the route component to /%C3%BCber (<div path="/%C3%BCber" />) fixes the refresh problem, but all <Link>s to the page are broken now.

Using the browsers back button results in the same urlencoded string.

Perhaps at https://github.com/developit/preact-router/blob/master/src/index.js#L33 the pathname should be decodeURIed.

NicolaiSchmid avatar Apr 01 '19 11:04 NicolaiSchmid