encoding of query string parameters in IE10

后端 未结 3 895
-上瘾入骨i
-上瘾入骨i 2020-12-03 07:30

I got a request from a customer that he wants to be able to type the query string of my web service with parameters in the IE10 address bar and get the service results. The

相关标签:
3条回答
  • 2020-12-03 08:02

    If the client is calling the web-service from javascript, encodeuricomponent can be used. In your case encodeuricomponent("מחרוזתבעברית");

    http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp

    0 讨论(0)
  • 2020-12-03 08:08

    Yes, your observation of the behavior is accurate. Internet Explorer 10 and below follow a complicated algorithm for encoding the URL. This was allegedly updated in Internet Explorer 11, but I've found that the new option doesn't seem to work.

    The "Always show encoded addresses option" concerns whether PunyCode is shown for IDN hostnames, and does not impact the query string. Send UTF-8 URLs mostly applies to the encoding of the path, although it can also affect other codepaths

    The behavior isn't fully documented anywhere. I'd meant to write a full post on my IEInternals blog about it but ended up moving on from Microsoft before doing so. There's a partial explanation in this blog post.

    Yes, there are settings that impact the behavior. The Send UTF-8 URLs checkbox inside Tools > Internet Options > Advanced is one of the variables that determines how URLs are sent, but the option does not blindly do what it implies (it only UTF-8 encodes the path, not the query string). Other variables involved include:

    1. Where the URL was typed (e.g. address bar vs. Start > Run, etc)
    2. What the system's ANSI codepage is (e.g. what locale the OS uses as default)
    3. The charset of the currently loaded page in the browser

    As a consequence of these variables, you cannot reliably use URLs which are not properly encoded (e.g. %-escaped UTF8) in Internet Explorer.

    0 讨论(0)
  • 2020-12-03 08:22

    Unfortunately this is still true for Internet Explorer 11 (build 11.0.9600.17358, win7-x64)

    I saw that you can not unfortunately change the web server. However those who are developing new services may consider changing request parameters into path variables, e.g. from http://myserver.com/page?τεστ into http://myserver.com/τεστ/

    0 讨论(0)
提交回复
热议问题