473,289 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Rendering "special characters" and html validation

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?
Jul 23 '05 #1
5 8685
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
Jul 23 '05 #2
"Sherm Pendley" <sp******@dot-app.org> wrote in message
news:no********************@adelphia.com...

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 "&amp;".

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 "&plusmn;". 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 &plusmn; made the symbol come up
correctly. The browsers apparently didn't understand the character directly.
Jul 23 '05 #3
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
Jul 23 '05 #4
Sherm Pendley wrote:
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

If you're going to declare UTF-8, you had better learn how to use it
correctly.
http://lachy.id.au/blogs/log/2004/12...unicode-part-1
http://lachy.id.au/blogs/log/2004/12...unicode-part-2
http://lachy.id.au/blogs/log/2005/01...unicode-part-3
Regardless of the encoding, ampersands must be represented correctly
in HTML, as "&amp;".


Technically, not always for HTML. It is acceptable to leave both "&"
and "<" unencoded, such as when followed by a space, a new line and a
few other situations; but it is a very good practice to always encode
them anyway. In XHTML, however, you are always required to encode them
correctly.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 23 '05 #5
Armand Karlsen wrote:

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


http://www.upsdell.com/BrowserNews/res_entities.htm
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: BenO | last post by:
Hi I'm new to python and need to write a function to replace certain characters in a string (html). The characters I need to replace come from MS Word copy & paste and are: ' (Left quote)...
2
by: Pawe³ | last post by:
Hello! I'm looking for efficient code or site where I can find code for finding one string in another string. String which I search should have "wild" characters like '?' for any one char and...
1
by: knocte | last post by:
Hello group. In the following testcase I attach to the final of the message, I have two questions: 1) According to comment # 1, how can I pass an argument to the function that way? 2)...
4
by: wob | last post by:
Many thanks for those who responded to my question of "putting greek char into C string". In searching for an solution, I noticed that there are more than one version of "Extended ASCII...
4
by: Jake Barnes | last post by:
Very odd. Check out this RSS feed that my PHP script just built: http://www.tagcastle.com/rss/photography.xml When I had a straight URL in the <link> tag, or the <comment> tag, then "="...
2
by: Diilb | last post by:
I am using DOM to create an rss feed. The problem I am running into is "special characters" such as é è ç. If I try adding them to the XML as character data (CData), DOM chokes and throws out...
2
by: Jens Jensen | last post by:
Hello gurus, For some reason, i need to submit an asp.net form to an asp form. Everything works as expected . the problem i'm left with is that some danish characters like Æ Ø are changed. ...
3
by: sophie_newbie | last post by:
Hi, I want to store python text strings that characters like "é" "Č" in a mysql varchar text field. Now my problem is that mysql does not seem to accept these characters. I'm wondering if there...
0
by: Jon Skeet [C# MVP] | last post by:
On Sep 30, 12:35 pm, "John Straumann" <jstraum...@hotmail.comwrote: <snip> What's the encoding of the file? That's the first important thing to know. See...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.