Click here to get back home

Rendering "special characters" and html validation

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Rendering "special characters" and html validation Armand Karlsen 02-28-2005
Get Chitika Premium
Posted by Armand Karlsen on February 28, 2005, 3:16 am
Please log in for more thread options


On this page of my website: http://www.zen62775.zen.co.uk/rigs.html
the W3C html validator claims that there are some bytes it cannot interpret
in line 49 of the html source as UTF-8. If I force ISO-8859-1 encoding,
however, the page will validate correctly but displays a warning about the &
character on the same line, saying that & is the "first character of a
delimiter but occurred as data". Is there any way to remedy this
problem/issue?

Secondly, the plus-minus (plus symbol immediately above a dash) symbol on
the same line of the html source does not render on my copy of Firefox 1.0
or Internet Explorer 6.0 SP1, instead appearing as a question mark. Does
this happen on other browsers, is there any way to make this character
render correctly?




Posted by Sherm Pendley on February 27, 2005, 10:52 pm
Please log in for more thread options


Armand Karlsen wrote:

> On this page of my website: http://www.zen62775.zen.co.uk/rigs.html
> the W3C html validator claims that there are some bytes it cannot
> interpret in line 49 of the html source as UTF-8. If I force ISO-8859-1
> encoding, however, the page will validate correctly

What do you mean by "force ISO-8859-1 encoding"?

Obviously the page is really 8859-1; if you put the correct content-type in
the page header, you wouldn't need to force the validator to ignore the
incorrect information that's in there now. What did you hope to accomplish
by misrepresenting the encoding, anyway???

> but displays a warning
> about the & character on the same line, saying that & is the "first
> character of a delimiter but occurred as data". Is there any way to remedy
> this problem/issue?

That has nothing at all to do with encoding. Regardless of the encoding,
ampersands must be represented correctly in HTML, as "&".

> Secondly, the plus-minus (plus symbol immediately above a dash) symbol on
> the same line of the html source does not render on my copy of Firefox 1.0
> or Internet Explorer 6.0 SP1, instead appearing as a question mark. Does
> this happen on other browsers, is there any way to make this character
> render correctly?

You can't really *force* anything. All you can do is provide the correct
entity for the character you want to display, which is "±". If you
have a browser that doesn't display that correctly, report the bug to that
browser's author.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


Posted by Armand Karlsen on February 28, 2005, 5:51 am
Please log in for more thread options


>
> What do you mean by "force ISO-8859-1 encoding"?
>
> Obviously the page is really 8859-1; if you put the correct content-type
in
> the page header, you wouldn't need to force the validator to ignore the
> incorrect information that's in there now. What did you hope to accomplish
> by misrepresenting the encoding, anyway???
>

Overriding the "default" page encoding in the W3C html validator. I had the
page in UTF-8 so I wouldn't have to juggle encodings if I were to put in
accents and other characters.

>
> That has nothing at all to do with encoding. Regardless of the encoding,
> ampersands must be represented correctly in HTML, as "&".
>

Is there a website/page with the correct representations of such symbols?

>
> You can't really *force* anything. All you can do is provide the correct
> entity for the character you want to display, which is "±". If you
> have a browser that doesn't display that correctly, report the bug to that
> browser's author.
>

Replacing the plus-minus in the source with ± made the symbol come up
correctly. The browsers apparently didn't understand the character directly.




Posted by Sherm Pendley on February 28, 2005, 1:42 am
Please log in for more thread options


Armand Karlsen wrote:

> Overriding the "default" page encoding in the W3C html validator. I had
> the page in UTF-8 so I wouldn't have to juggle encodings if I were to put
> in accents and other characters.

That's the problem - the page *isn't* encoded in UTF-8, it's ISO-8859-1. The
"encoding" attribute you used in the page is wrong. That's why overriding
the encoding worked around the problem - you told the validator what the
correct encoding is, and told it to ignore the incorrect information it
found in the page itself.

> Is there a website/page with the correct representations of such symbols?

Somewhere on the W3 site, I'd imagine... (click, click, click...) Ah, here
we go:

<http://www.w3.org/TR/html4/sgml/entities.html>

> Replacing the plus-minus in the source with &plusmn; made the symbol come
> up correctly. The browsers apparently didn't understand the character
> directly.

The browsers I tested - Mozilla and Safari - both understand it fine, once
the encoding was declared correctly. The problem isn't the character, the
problem is that you're telling the browser the document was UTF-8, when in
fact it was 8859-1 encoded.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


Posted by C A Upsdell on February 28, 2005, 9:45 am
Please log in for more thread options


Armand Karlsen wrote:
>
> Is there a website/page with the correct representations of such symbols?

http://www.upsdell.com/BrowserNews/res_entities.htm


Similar ThreadsPosted
& special characters May 29, 2006, 6:48 am
Special characters used in Excel January 28, 2005, 4:29 am
differences in rendering xhtml and html November 13, 2006, 5:26 am
Chinese Characters in html (coding on a Mac OS X) February 13, 2006, 10:48 pm
Translating foreign characters to HTML code June 25, 2005, 2:35 pm
strange html code to set the type of characters December 7, 2005, 12:10 am
Problem with rendering some colors when printing an HTML document by Internet Explorer January 26, 2005, 5:47 pm
web site to translate spanish characters into corresponding html codes? April 14, 2008, 10:16 pm
special pop-up October 7, 2007, 1:50 pm
HTML validation November 4, 2004, 12:41 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap