Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL with unicode characters will not load in MS Edge #343

Closed
ardeois opened this issue Jan 13, 2020 · 0 comments · Fixed by #344
Closed

URL with unicode characters will not load in MS Edge #343

ardeois opened this issue Jan 13, 2020 · 0 comments · Fixed by #344

Comments

@ardeois
Copy link
Contributor

ardeois commented Jan 13, 2020

Description

When you have a route path containing a unicode character, it is recommended to use encodeURI so reach router supports it correctly. This works well in all browsers but it doesn't work in MS Edge.

Example:

<Router>
  <App path="/">
      <Home path="/" />
      <Unicode path={encodeURI("påge")} />
  </App>
</Router>

After some investigation, it seems that in MS Edge, the window.location.pathname is not url encoded, but other browsers encode it.
This results in not found route when a url contains a special character.

I have opened a pull request to suggest a fix, see #344

Steps to reproduce

In Chrome, you'll see the page title Page with unicode in url works !, but in MS Edge you don't

Related Issues

I've discovered this bug by digging into a gatsby issue. See gatsbyjs/gatsby#17556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant