简体   繁体   中英

Windows Phone equivalent of DontUnescapePathDotsAndSlashes for encoded urls

My question is the same as Keep url encoded while using URI class but regarding Windows Phone where things work differently.

I have a URL for the payment gate that contains a url encoded part and looks like this

https://api.platebnibrana.csob.cz/api/v1.5/payment/process/M1MIPS0385/a820a587a8350BD/20160420123549/xDMboIwEloc3RPw1hwr22ByqMNyS4QZEkisZDlM%2bembBlET8QtzEfapMxMN8AcnnxqbKV4uEN2iTMg3TbGhcEXmlZJ6a9ZPkL7M7dBr3FkDVc11gg9zjX%2bUd1Ge7BCQtEm0DtNU8sVE%2fX56VvekooHy0T5hidQZrIIGNg1rnz3f2%2fuz1aNc5dVQSTcnfXxNlBRSMbd6kcTmKE04SjB65233ydO%2fowbQE%2fmJuUrc5w0D9YFmlM4zu16SlmDqmdcinenSv4cVkKiXMk8OYANBCJBKegRtFUo303rZRZCUHH5WI1xg55%2fGo%2bFRKV4DsIPBeSMpVf9pEBtZ6YDVMnNKpLg%3d%3d

when I try to create an Uri from it to be used with WebBrowser it changes to

https://api.platebnibrana.csob.cz/api/v1.5/payment/process/M1MIPS0385/a820a587a8350BD/20160420123549/xDMboIwEloc3RPw1hwr22ByqMNyS4QZEkisZDlM+embBlET8QtzEfapMxMN8AcnnxqbKV4uEN2iTMg3TbGhcEXmlZJ6a9ZPkL7M7dBr3FkDVc11gg9zjX+Ud1Ge7BCQtEm0DtNU8sVE/X56VvekooHy0T5hidQZrIIGNg1rnz3f2/uz1aNc5dVQSTcnfXxNlBRSMbd6kcTmKE04SjB65233ydO/owbQE/mJuUrc5w0D9YFmlM4zu16SlmDqmdcinenSv4cVkKiXMk8OYANBCJBKegRtFUo303rZRZCUHH5WI1xg55/Go+FRKV4DsIPBeSMpVf9pEBtZ6YDVMnNKpLg==

which is wrong. According to the mentioned quetsion, the solution is to make a change in the app.config. But there is no app.config in Windows Phone apps.

So is there a way to force Uri not to decode (and screw) the url in Windows Phone?

It is terribble bug in .net see eg GETting a URL with an url-encoded slash

When %2f in path is unescaped to /

I found a solution. Try navigate WebBrowser component to string with this body: <html><body><scirpt type="text/javascript">window.location = "url";</script></body></html> where url is your original url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM