<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1243</bug_id>
          
          <creation_ts>2005-04-12 19:43:15 +0000</creation_ts>
          <short_desc>[F&amp;O] fn:escape-uri needs to be invertible in the true() case; take out the % exception</short_desc>
          <delta_ts>2005-09-29 10:40:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://lists.w3.org/Archives/Public/public-qt-comments/2005Apr/0057.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="C. M. Sperberg-McQueen">cmsmcq</reporter>
          <assigned_to name="Ashok Malhotra">ashok.malhotra</assigned_to>
          <cc>connolly</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3730</commentid>
    <comment_count>0</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2005-04-12 19:43:15 +0000</bug_when>
    <thetext>[posted in Bugzilla by cmsmcqW3.org on behalf of Dan Connolly;
text below is copied from his note to qt-comments.]

Regarding...

&quot;Generally, $escape-reserved should be set to true when escaping a
string that is to form a single part of a URI, and to false when
escaping an entire URI or URI reference.&quot;
http://www.w3.org/TR/2005/WD-xpath-functions-20050404/#func-escape-uri

Indeed, those are the two relevant tasks. I might prefer
separate functions, as the tasks are quite unrelated.
In any case, the exception for the % character makes this
function unsuitable for the task of &quot;form[ing] a single part of a URI&quot;.

As specified, fn:escape-uri(&quot;gross %each&quot;) returns &quot;gross%20%each&quot;
but that doesn&apos;t actually encode the string &quot;gross %each&quot; into
part of a URI such that the party that encoded it can decode it
again. In order to be useful, it needs to return
&apos;gross%20%25each&apos; . It needs to be invertible.

i.e. XQuery should follow all the other programming languages
out there, such as

- python
 http://docs.python.org/lib/module-urllib.html

&gt;&gt;&gt; urllib.quote(&quot;gross %each&quot;)
&apos;gross%20%25each&apos;

- perl

perl -e &apos;use URI::Escape; print uri_escape(&quot;gross %each&quot;), &quot;\n&quot;&apos;
gross%20%25each

http://www.gsp.com/cgi-bin/man.cgi?section=3&amp;topic=URI::Escape

- javascript

http://www.javascripter.net/faq/escape.htm

I can&apos;t find the standard library functions for Java and C#
with a few minutes of googling, but I&apos;ll bet they work likewise.

p.s. yes, this is essentially the same comment I made back in 2003.
http://lists.w3.org/Archives/Public/uri/2003Mar/0027.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3443</commentid>
    <comment_count>1</comment_count>
    <who name="Ashok Malhotra">ashok.malhotra</who>
    <bug_when>2005-05-10 18:21:21 +0000</bug_when>
    <thetext>On the 5-10-05 telcon the joint WGs confirmed the decision taken during mtg 252
re. fn:escape-uri.  Essentially, this decision was 
1 remove the the percent-sign (%) from the list of characters not to be escaped
when the &quot;escape-reserved&quot; argument had the value &quot;true&quot;.  
2 add the percent-sign to the list of characters not escaped when
&quot;escape-reserved&quot; argument had the value &quot;false 

This means that the percent-sign is escaped when escape-reserved is &quot;true&quot; and
not  escaped when escape-reserved is &quot;false&quot;.

Please confirm that this is what was intended and that it resolves the problem.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>