httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32877] New: - wrong utf-8 encoding/escaping in a href for umlaut's
Date Wed, 29 Dec 2004 16:07:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32877>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32877

           Summary: wrong utf-8 encoding/escaping in a href for umlaut's
           Product: Apache httpd-2.0
           Version: 2.1-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_dav
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: zeller@rupert.franken.de


In mod_dav.c, the function dav_send_one_response (around line 445) calls the 
function dav_xml_escape_uri, which in turn will call ap_escape_uri. 
The ap_escape_uri function will translate all non-alphanumeric characters 
to a %xx encoding. 
 
Because mod_dav claims both in the HTTP header as well as in the XML header 
that all data is in utf-8, this gives wrong results if the XML parser on the 
receiver side is strict. 
 
This is an excerpt from a tcpdump session between cadaver and Apache: 
<D:response xmlns:i0="DAV:" xmlns:lp0="DAV:" 
xmlns:lp1="http://apache.org/dav/props/" 
xmlns:i1="http://apache.org/dav/props/"> 
<D:href>/Gel%f6schte%20Dateien/</D:href> 
<D:propstat> 
<D:prop> 
<lp0:getlastmodified xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" 
b:dt="dateTime.rfc1123">Sun, 04 Jul 2004 04:00:00 GMT</lp0:getlastmodified> 
<D:resourcetype><D:collection/></D:resourcetype> 
</D:prop> 
<D:status>HTTP/1.1 200 OK</D:status> 
</D:propstat> 
<D:propstat> 
<D:prop> 
<i0:getcontentlength/> 
<i1:executable/> 
<i0:checked-in/> 
<i0:checked-out/> 
</D:prop> 
<D:status>HTTP/1.1 404 Not Found</D:status> 
</D:propstat> 
</D:response> 
 
The /Gel%f6schte%20Dateien/ href is "Gelöschte Dateien" in the filesystem. 
The encoding /Gel%f6schte%20Dateien/  is is fine if the content transfer  
type and the XML encoding would be ISO-Latin1 or ISO-Latin15, but it is 
completly wrong with UTF-8. 
 
There are two ways to fix the problem: 
1) blindly believe that the underlying OS is working with Latin1 file 
   names, and simply change the utf-8 coding to a latin1 coding in 
   the HTTP/XML headers 
2) write a correct dav_xml_escape_uri function, that doesn't use 
   ap_escape_uri, see  
   http://sera.desuyo.net/WebDAV/mod_dav-1.0.2-1.3.6.patch  
   for an example 
 
The Windows WebDrive WebDAV client works with this wrong encoding, 
but in KDE Konqueror 3.3 won't show the file name correctly. 
 
Bye, 
 
Jürgen

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message