james438
08-23-2007, 09:37 PM
Hi. In short I am trying to validate my site. It is a long process. I am going from transitional to strict. I have a code that $summary to htmlentities, preg_replaces sets of two spaces into and then I use html_entity_decode to change it back.
The problem is that the w3 validator won't validate it because of the PHP.net has this note about using that I don't quite understand
' ' entity is not ASCII code 32 (which is stripped by trim()) but ASCII code 160 (0xa0) in the default ISO 8859-1 characterset. html_entity_decode() (http://us2.php.net/manual/en/function.html-entity-decode.php)
The failure statement reads
Sorry, I am unable to validate this document because on line 1 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xA0" does not map to Unicode
Any ideas on what I can do? I would prefer to keep the if I can, so that the browser doesn't condense sets of spaces when I don't want it to.
I am using
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
EDIT: Sorry, I got it. Instead of using I am going to use & #160; (without the space between the & and #. The forum won't display the pattern I see.)  problem solved. Now I am off to revalidating. This will certainly take a while.
The problem is that the w3 validator won't validate it because of the PHP.net has this note about using that I don't quite understand
' ' entity is not ASCII code 32 (which is stripped by trim()) but ASCII code 160 (0xa0) in the default ISO 8859-1 characterset. html_entity_decode() (http://us2.php.net/manual/en/function.html-entity-decode.php)
The failure statement reads
Sorry, I am unable to validate this document because on line 1 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xA0" does not map to Unicode
Any ideas on what I can do? I would prefer to keep the if I can, so that the browser doesn't condense sets of spaces when I don't want it to.
I am using
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
EDIT: Sorry, I got it. Instead of using I am going to use & #160; (without the space between the & and #. The forum won't display the pattern I see.)  problem solved. Now I am off to revalidating. This will certainly take a while.