Search code examples
delphiinternet-explorer-11intrawebdelphi-10.1-berlin

Why does IE11 transform my URL with parameters?


I have an intraweb application that I call with the following url, containing 1 parameter.

http://127.0.0.1:8888/?0001=„V‡&

When I enter the URL in IE11, it is transformed to the following.

http://127.0.0.1:8888/$/?0001=%EF%BF%BD%EF%BF%BDV%EF%BF%BD

It works in Chrome and Opera which passes parameter in it's original form to the application. Any ideas how I can stop IE11 from transforming the parameter?

I'm using IE11, Delphi 10.1 Berlin and Intraweb 14.0.53.


Solution

  • Non-ASCII characters like and are not allowed to appear un-encoded in a URL, per RFC 3986 (an IRI via RFC 3987 allows it, but HTTP does not use IRIs). Certain ASCII characters are also reserved as delimiters and must not appear un-encoded when used for character data.

    IE is doing the correct thing. Before transmitting the URL, restricted characters must be charset-encoded to bytes (IE is using UTF-8, there is no way for a URL to specify the charset used) and then the bytes must be percent-encoded in %HH format.

    The webserver is expected to reverse this process to obtain the original characters - convert %HH sequences to bytes, and then charset-decode the bytes to characters. The browser and web server must agree on the charset used. UTF-8 is usually used, but not always. Some foreign country servers might use their own locales instead.

    This is part of the URL and HTTP specifications. All web servers are required to recognize and decode percent-encoded sequences.

    Chrome and Opera should be doing the same thing at the networking layer that IE is doing, even if they are not updating their UIs to reflect it. You can use a packet sniffer, like Wirkshark or Fiddler, to verify exactly what each browser is actually transmitting to the web server.