Bug 32877 - wrong utf-8 encoding/escaping in a href for umlaut's
Summary: wrong utf-8 encoding/escaping in a href for umlaut's
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dav (show other bugs)
Version: 2.1-HEAD
Hardware: All All
: P2 enhancement with 3 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: MassUpdate
Depends on:
Blocks: 22138
  Show dependency tree
Reported: 2004-12-29 17:07 UTC by J
Modified: 2018-11-07 21:09 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description J 2004-12-29 17:07:34 UTC
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:" 
<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:status>HTTP/1.1 200 OK</D:status> 
<D:status>HTTP/1.1 404 Not Found</D:status> 
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  
   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. 
Comment 1 J 2004-12-29 17:13:09 UTC
I think Bug #22138 is related to this bug. 
Comment 2 Julian Reschke 2006-01-08 12:25:32 UTC
This is known, by design, and technically correct. Please don't confuse encoding
of XML bodies with encoding of non-ASCII characters in URLs. These two things
are unrelated.

For more information, please read
(feedback appreciated).
Comment 3 William A. Rowe Jr. 2018-11-07 21:09:19 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.