We are designing a URL system that will specify application sections as words separated by slashes. Specifically, this is in GWT, so the relevant parts of the URL will be in the hash (which will be interpreted by a controller layer on the client-side):
http://site/gwturl#section1/section2
Some sections may need additional attributes, which we'd like to specify with a :
, so that the section parts of the URL are unambiguous. The code would split first on /
, then on :
, like this:
http://site/gwturl#user:45/comments
Of course, we are doing this for url-friendliness, so we'd like to make sure that none of these characters which will hold special meaning will be url-encoded by browsers, or any other system, and end up with a url like this:
http://site/gwturl#user%3A45/comments <--- BAD
Is using the colon in this way safe (by which I mean won't be automatically encoded) for browsers, bookmarking systems, even Javascript or Java code?