W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2003

why the special case for % in fn:escape-uri?

From: Dan Connolly <connolly@w3.org>
Date: 14 Mar 2003 11:22:18 -0600
To: public-qt-comments@w3.org, Graham Klyne <GK@NineByNine.org>
Cc: uri@w3.org
Message-Id: <1047662532.25644.61.camel@dirk.dm93.org>

I see: Examples
      * fn:escape-uri
        ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean", true()) returns "gopher%3A%2F%2Fspinaltap.micro.umn.edu%2F00%2FWeather%2FCalifornia%2FLos%20Angeles%23ocean"


but the % after Los needs to be escaped, no?

i.e. the result should be ala...

>>> from urllib import quote
>>> s =
>>> quote(s, safe='')

Note the ...Los%2520...

Hmm... the spec seems to special-case this:

  The "%" character itself is escaped only if it is not followed
  by two hexadecimal digits (that is, 0-9, a-f, and A-F)

I don't understand why.

Also... what does 'when escaping an entire URI or URI reference' refer

Hmm... Graham, have you thought about a suite of tests for
URI escaping issues?

Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Friday, 14 March 2003 12:21:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:11 UTC