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

测试案例 'by handler, should call handler, match non ascii string as rule :xxx' 在 ie 下运行出错 #46

Open
zhengmz opened this issue Aug 5, 2021 · 0 comments

Comments

@zhengmz
Copy link

zhengmz commented Aug 5, 2021

1. 版本: 1.2.4

2. 测试用例:

expect(e.params.name).toBe('%E4%BD%A0%E5%A5%BD');

在 ie8 或 ie11 下运行出错。

3. 原因分析:

ie下的 hash 没有对中文URI 进行编码,其 location.hash 和 location.href 都保留中文编码:

  • hash: #/route-test/non/asc/你好
  • href: http://127.0.0.1:5500/test/?spec=Router%20by%20handler%2C%20should%20call%20handler%2C%20match%20non%20ascii%20string%20as%20rule%20%3Axxx#/route-test/non/asc/你好

4. 建议:

在代码

var value = match[j];

中增加 decodeURIComponent

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

No branches or pull requests

1 participant