Reputation: 31
I masked all special characters in the following URL, but w3c-validator still throws error. I checked all the NFC Tutorials but I have no idea where is the error. Any idea ?
URL
<a href="http://www.example.de/index.php?cnid=efcb9a458fb823ba877ef53b7162598f&ldtype=grid&cl=alist&tpl=&fnc=executefilter&fname=&attrfilter[3a5d1ca314a5205fa7b7b3baa5d2f94e][2f143d22ce421269b5c7d01a160f6541]=2f143d22ce421269b5c7d01a160f6541">Asche</a>
w3c-Error
Line 618, Column 441: Bad value http://www.example.de/index.php?cnid=efcb9a458fb823ba877ef53b7162598f&ldtype=grid&cl=alist&tpl=&fnc=executefilter&fname=&attrfilter[3a5d1ca314a5205fa7b7b3baa5d2f94e][2f143d22ce421269b5c7d01a160f6541]=2f143d22ce421269b5c7d01a160f6541 for attribute href on element a: Illegal character in query component.
…21269b5c7d01a160f6541]=2f143d22ce421269b5c7d01a160f6541">Asche</a></li>
Syntax of IRI reference
Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.
Upvotes: 3
Views: 2534
Reputation: 201538
The characters [
and ]
need to be %-encoded in a URL, as %5B
and %5D
, according STD 66 (where Appendix A contains a syntax summary, showing that the brackets are “gen-delims” characters, which are not allowed in a query part except as %-encoded).
You should have posted an HTML document, since that’s what validators work on. The following test document (which validates) contains the URL you mention, properly encoded:
<!doctype html>
<meta charset=utf-8>
<title></title>
<a href=
"http://www.example.de/index.php?cnid=efcb9a458fb823ba877ef53b7162598f&ldtype=grid&cl=alist&tpl=&fnc=executefilter&fname=&attrfilter%5B3a5d1ca314a5205fa7b7b3baa5d2f94e%5D%5B2f143d22ce421269b5c7d01a160f6541%5D=2f143d22ce421269b5c7d01a160f6541">foo</a>
Quite apart from this, the URL does not work; it causes a “Multiple Choices” response, which is rather odd (such a message should be issued when the server is doing some content negotiation that does not find an acceptable alternative, and a list of alternatives should be presented; but here it’s more or less a “Not Found” situation).
Upvotes: 3