# Issue 25916

Starred by 5 users

Status: Duplicate issue 45051 ---- Aug 2010 UI UI>Browser>Omnibox ---- ---- All 2 Bug

Restricted
• Only users with Commit permission may comment.

# Chrome converts every backslash in the URL into forward slashes

Reported by mr.ca...@gmail.com, Oct 27 2009

### Issue description

Chrome Version       : 3.0.195.27 (Official Build 28507)
URLs (if applicable) : http://texify.com/$x=\int{-b\pm\sqrt{b^2-4ac}$
Other browsers tested: Firefox
Add OK or FAIL after other browsers where you have tested this issue:
Safari 4:
Firefox 3.x: OK
IE 7:
IE 8:

What steps will reproduce the problem?
1. Copy the URL in the address bar
2. Click Go
3.

What is the expected result?
That url to be accessed

It is accessing the URL with the backslashes converted to forward slashes.

possible.


Regarding other browsers:
Safari 4 - FAIL, Opera 10 - FAIL, Firefox 3 - OK, IE 7/8 - FAIL (and Chrome - FAIL)

One response to this issue is that according to http://www.ietf.org/rfc/rfc2396.txt
backslash characters are not valid characters in URLs so how Firefox handles invalid
URL characters (including the backslash) may not be the way Chrome and other browsers
handle the backslash.  All other browsers tested in this comment convert the
backslash into forward slashes.

Technically, if you required backslash characters in your URL you need to encode them
using %5C.  The above URL with the backslashes encoded is:
http://texify.com/$x=%5Cint{-b%5Cpm%5Csqrt{b^2-4ac}$

In fact, the above URL with all invalid characters encoded properly would be:

http://texify.com/$x=%5Cint%7B-b%5Cpm%5Csqrt%7Bb%5E2-4ac%7D$

 Labels: -Area-Misc Area-BrowserUI Status: Untriaged
However, the other response is that there is one problem that is only in Chrome.

When going to the fully encoded URL given in Comment 2, Chrome will update the
Omnibox URL with the decoded characters.  However, if you then highlight the Omnibox
URL and Copy it, then Paste it again it shows as:
http://texify.com/$x=/int%7B-b/pm/sqrt%7Bb%5E2-4ac%7D$

This problem is only in Chrome.  Firefox will preserve the backslashes, and the other
browsers do not redisplay the decoded characters but keep the character encodings.

There is definitely a Chrome only bug that "Chrome converts every backslash in the
URL into forward slashes".

Well, it was not my intention to report this exactly as a bug but as an "inconvenient
feature"

AFAIK that RFC does not force any browser to especifically replace backslashes with
forward ones. IMHO "\" would be better replaced with "%5C" than with "/" in the same
way as " " is replaced with "%20" or "{" is replaced with "%7B".

I know that inserting Latex strings in URLs could sound weird. But "/" is not the
same as "\" and maybe when a user writes "\" he means "\" ("%5C").

Concerning #3, I would not call that a bug. Every browser shows the "%20"
replacements in the address bar, I don't see the point of hiding the slash replacements.

Comment #3 is definitely a bug.

Every other browser except Firefox shows the encoding replacements (maintaining %5C for
the backslashes) which is fine.  Firefox shows the decoded characters but preserves the
backslashes when copying and pasting, which is also fine.

Chrome also shows the decoded characters but changes backslashes to forward slashes
after copying and pasting, which is a bug.

 Labels: Mstone-X Feature-Omnibox Status: Available
I've looked into it a bit - looks like it's converted by googleurl's path
canonicalizer.  In googleurl/src/url_canon_path.cc there's a line that silently
converts backslashes to forward slashes.  It won't be very hard to fix it (e.g. make
it optional), but I'm not sure how I can change the code in googleurl.

 Labels: -Area-BrowserUI Area-UI-Features
Area-UI-Features label replaces Area-BrowserUI label

 Labels: -Area-UI-Features Area-UI
 Mergedinto: 45051 Status: Duplicate
This issue has been closed for some time. No one will pay attention to new comments.