question

PrasanthKalivarapu-1062 avatar image
0 Votes"
PrasanthKalivarapu-1062 asked XuDongPeng-MSFT commented

Space in URL is getting encoded differently on different machines?

We are navigating to URL and URL contains a space is shown as below:
URL: www.google.com www.oracle.com

While navigating on machine 1: edge browser url showed www.google.com%20www.oracle.com
Same on Machine 2: edge browser url showed as www.google.com%C2%A0www.oracle.com

Is there any setting wrt to internet options to work differently?

ms-edge
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

XuDongPeng-MSFT avatar image
0 Votes"
XuDongPeng-MSFT answered XuDongPeng-MSFT commented

Hi @PrasanthKalivarapu-1062 ,

While navigating on machine 1: edge browser url showed www.google.com%20www.oracle.com
Same on Machine 2: edge browser url showed as www.google.com%C2%A0www.oracle.com

I looked up some relevant information and I found that they are not the same space, in the second url you provided, it is actually a Non-breaking Space. A simple using Bing :

196018-image.png

A normal space is url encoded as %20, and a non-breaking space is url encoded as %C2%A0. This caused your current problem, I suggest that they can be properly checked, and the normal space is a little wider than the non-breaking space in the text.

Regards,
Xudong Peng


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (29.6 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am not modifying or adding any information to differentiate a normal space and non breaking space.
The only thing we do here is provide space in the url -- basically url is for a defined folder path which contains space.

While trying to navigate that url from different machines behaves differently as mentioned above.
One brings normal space and other brings non breaking space. does browser has the capability to encode space to non breaking space?

0 Votes 0 ·
XuDongPeng-MSFT avatar image XuDongPeng-MSFT PrasanthKalivarapu-1062 ·

Hi @PrasanthKalivarapu-1062 ,

The doc RFC3986 has made detailed suggestions on the encoding and decoding of Url, pointed out which characters need to be encoded so as not to cause the change of Url semantics, and explained why these characters need to be encoded.

An space may be escaped to the already mentioned %20, or the + character (as a query string). But I don't think it's going to be encoded as something that doesn't correspond to its ASCII code.

By the way, do the machines you are tested on have the same environment (os and browser version)? As far as I know, in MacOS, the alt+space key combination is a non-breaking space. Does the same issue occur in Chrome?

0 Votes 0 ·

Yes the same issue occur with chrome as well.

0 Votes 0 ·
XuDongPeng-MSFT avatar image XuDongPeng-MSFT PrasanthKalivarapu-1062 ·

Hi @PrasanthKalivarapu-1062 ,

Well, this issue is really strange, have you found this issue in other machines. I did some tests, but the characters are escaped correctly so that I cannot reproduce this issue. You can also try other non-chromium based browsers, such as IE, Firefox. This also helps to find the cause of this problem. Thank you for your understanding.

0 Votes 0 ·