26

Is %3B treated differently to %3b in an URL?

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
hugomg
  • 68,213
  • 24
  • 160
  • 246
  • 1
    I found some conflicting information. I thought asking a question would be the easiest way to clear things up. – hugomg Nov 03 '11 at 11:49
  • Ok. I believe the information in the link says that it's from the RFC. But how it's implemented is always a mystery with browser manufacturers. ;) – Christian Wattengård Nov 03 '11 at 11:52

1 Answers1

37

No, URL percent-encoding is NOT case sensitive. According to RFC 3986:

2.1. Percent-Encoding

[...]

The uppercase hexadecimal digits 'A' through 'F' are equivalent to the lowercase digits 'a' through 'f', respectively. If two URIs differ only in the case of hexadecimal digits used in percent-encoded octets, they are equivalent.

Community
  • 1
  • 1
Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
  • 4
    It may be appropriate to mention that in cases where a URI is used for a namespace declaration in XML (also XHTML, SOAP etc), that percent-encoding has no effect (it is not decoded) and simply part of the string that makes up the namespace. As a result, it *is* case-sensitive. I.e. `xmlns:t="http://foo.bar/%2A"` is *not equal, nor equivalent* to `xmlns:t="http://foo.bar/%2a"`. – Abel Aug 24 '16 at 10:44
  • 1
    @Abel while true, that's really down to XML namespaces not really being URIs (although their specification falsely claims otherwise). For example, the part of the namespace which purports to be a domain component is also case-sensitive in XML namespace declarations, in violation of RFC 3986. – Zero Piraeus Apr 28 '17 at 16:17
  • exactly, that was the point here, thanks for giving more context – Abel Apr 28 '17 at 18:34