Google using illegal characters according to

I just ran my HTML through the W3C HTML validator and it tells me that the code Google gave me for loading fonts uses an illegal character. Is this really true? Here’s the error message:

Error: Bad value|Open+Sans for attribute href on element link: Illegal character in query: | is not allowed.
From line 14, column 5; to line 14, column 100
d -->↩    <link href="|Open+Sans" rel="stylesheet">↩  <!-
Syntax of URL:
Any URL. For example: /hello, #canvas, or Characters should be represented in NFC and spaces should be escaped as %20. Common non-alphanumeric characters other than ! $ & ' ( ) * +  - . / : ; = ? @ _ ~ generally must be percent-encoded. For example, the pipe character (|) must be encoded as %7C.

It’s telling you that the pipe | between ‘One’ and ‘Open’ should be replaced with %7C.

Pretty simple fix :slight_smile:

What I’m interested in is the difference between what Google says is ok, and what W3C says is ok. That line for the fonts was copy/pasted right from Google, and Google is using the pipe to split the first and second names of the two fonts. And it works, even though W3C says it’s wrong.

So, is W3C just wanting something of a higher standard than even Google produces right now, or, does it work because the call is to Google and Google understands what it means, or…?

Just curious how things get to decide what’s right or wrong, and who gets higher priority.

Yeah, Google is in the wrong. W3C set the standards.

But it will still work because the browsers are forgiving :slight_smile:

1 Like

Awesome. Thanks! I looked up the HTML entity code for the | and replaced it in Google’s link. And it works great.