Re: FYI: Pipe character in stylesheet url replaced with pipe and space causes error

On Tue, 7 Sep 2004, Paul Bryant <GAP66> wrote:

> I have been linking to stylesheets with code similar to:
>
> <link rel="stylkesheet" type="text/css" href="/.i/css-3D/3D|3D/3DBl" />
>
> I found that when trying to validate the css the validator returned 404 File
> Not Found for the url:
>
> "/.i/css-3D/3D| 3D/3DBl" (note the space after the pipe character)

I don't know what the "CSS Validator" does with the URL, but by URL
specifications, the vertical line, or "pipe", character "|" is disallowed
in URLs. It may only appear as URL encoded (%7C). Ref.: RFC 2396,
available as hypertext at http://www.cs.tut.fi/~jkorpela/rfc/2396/toc.html

Maybe the "CSS Validator" treats "|" as terminating a URL. This is
suboptimal; ideally, when a program processes a construct like an
href attribute value, it should first verify that it complies with URL
syntax and either issue an error message or take some appropriate, planned
error recovery action if it does not. But this is far from easy.

> I have now changed my code to use underscores instead of pipes and the
> validator works fine - (and my css passes ;-).

If you can use "_" instead of "|", that's fine - the underline
(underscore) character is permitted in URLs as such.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 7 September 2004 19:15:16 UTC