-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
router-view does not render as path contains non-ascii or unicode characters. #838
Comments
Also interesting note. Open up the console in chrome. When switching between the routes logs both of them out. On safari and firefox the I'd also note that the functionality in firefox is different too... if you click the Super strange. |
Actually, non-ascii characters are not allowed in url, though it seems chrome decided to support them.
|
Well that's great, but at the very least the router should see that and throw an error. Regardless of wether it is or it isn't, people might try to do it and have inconsistent app behavior because of that. Regardless of browser support this is a legitimate issue. I don't feel like this thread should be closed. |
Adding a warning would improve the Developer experience and it's easy to add. I'll add it |
I added a warning but shouldn't we encode the path to make it work across all browsers even if it looks bad ? |
That would be assuming the user wants to use UTF-8...( |
I tested a bit further and I think we should encode the path on hash mode (the default, as used on the jsfiddle) @fnlctrl Are you sure about that? I just used the |
It's encoded in GBK using other tools. On second thought I think it should be fine to encode the path for users, since they can still encode them manually before passing into routes array if they want. |
@fnlctrl They actually cannot encode the pathes themselves if we chose to encode them |
When using Firefox 55.0 and routes with Chinese characters the route change event is fired twice. OK in Chrome, IE and Edge. |
I have the same issue in last Firefox 55.0.3 (32-bit) see quasarframework/quasar#936 |
Hi! I have a kind of super-ugly workaround for related issue: nuxt single file components named in cyrillic produce incorrect cyrillic URIs. I think it is not directly connected with the issue being discussed, but may be useful for someone or give some ideas about how to fix current issue. Also I'd note that it is not good to ignore the issue and close its siblings. Using unicode url is important for SEO in many countries and it is an essential competitive advantage. I didn't test exactly this commit, but similar one from a bit earlier version worked fine with Edge, Firefox and Chrome with the nuxt site produced by 'npm run generate'. In Chrome, it works with 'npm run dev', 'npm run build' and 'npm run generate'. Maybe one can clone routes with unicode paths like I do, but do it in extendRoutes config. Obviously it is not a proper fix because paths are duplicated. Also beware that I'm a complete newbie in JS so things I do can be quite stupid :) |
I agree with @budden that unicode characters in URL are important in some countries. I actually have a requirement from client that routes should be in cyrillic, like on Wikipedia In my case the HTML is generated and the page is display, but no Vue.js lifecycle methods are executed (for example a console.log in the mounted method). I opened an issue about this on nuxt.js issues page: nuxt/nuxt#2888 (the problem is only manifested on statically generated site) |
In VuePress, now we have a perfect workaround for that: vuejs/vuepress#473 Hope that can help you. |
Is that gonna be resolved soon? |
@posva Great! when will be the next release? 🤔 |
Closing in favor of #3110 |
When the path contains non-ascii characters like chinese words, it works fine in Chrome, but not in Safari and Firefox.
Repro link: https://jsfiddle.net/a2v5rrcp/3/
The text was updated successfully, but these errors were encountered: