Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 "A numeric character reference expanded to the C1 controls range" error when using “

Tags:

html

i have this html code:

<span class="comma_left">&#147;</span>

And

<span class="comma_right">&#148;</span>

As well, both representing left & right commas.

Strange thing though, HTML5 validation throws the error:

"A numeric character reference expanded to the C1 controls range."

I really don't want to just avoid this error, what can i do?

like image 759
Tom Avatar asked Mar 21 '11 15:03

Tom


2 Answers

The C1 control range refers to characters mapped to byte encodings 0x80 to 0x9f (128 to 159) in Latin-1, or to Unicode code points U+0080 to U+009F. Unicode considers these to be "control characters", which are explicitly disallowed by the HTML5 parsing algorithm.

Your problem is occurring because you're using the Windows code page 1252 encodings of directed double-quote marks, which are incompatible with both Latin-1 and Unicode. You could try these compatible variants:

  • Left double-quote: &ldquo; or &#8220;
  • Right double-quote: &rdquo; or &#8221;
like image 51
Michael Ratanapintha Avatar answered Oct 12 '22 11:10

Michael Ratanapintha


Try to change &#147; by &#8220; and &#148; by &#8221; it seen to be the same caracter and valid W3C.

like image 34
Yoann Avatar answered Oct 12 '22 10:10

Yoann