Commas won't validate until manually replaced with the same thing.
Adam5000
1:44 pm on Aug 20, 2010 (gmt 0)
Mystery to me.
I'm validating my pages and getting errors where the commas and quotation marks are.
The error messages read non SGML character.
The part I don't understand is, when I backspace through the comma or quotation mark that the validator doesn't like and rekey it, it works.
What's happening?
alias
2:07 pm on Aug 20, 2010 (gmt 0)
I suppose you're probably copying and pasting that content from somewhere, let's assume Word. That software (or sometimes people who wrote that document) sometimes uses the different "quotes "like ` or ” or ’ or ` or “ a different hyphen, which sometimes looks like a normal hyphen.
By different I mean not one from the common ASCII char table, but one from an extended keyboard or characted set.
Super_B
3:30 pm on Aug 20, 2010 (gmt 0)
@Adam5000
+1 to what @alias said, and also it needs to be added that quotes (") are technically for HTML attribute markup, like:
<img src="...">
so you should use " in your text like so:
<strong title="The British Bulldog">Winston Churchill</strong> said, "We shall never surrender."
Outputs: Winston Churchill said, "We shall never surrender."
Adam5000
5:39 pm on Aug 20, 2010 (gmt 0)
That's correct. Very astute of you. Most of the content of my website is written and created on Word and WordPerfect and pasted into notepad.
Is there an easy fix?
Adam5000
5:44 pm on Aug 20, 2010 (gmt 0)
Astute is the wrong word. I meant perceptive.
LifeinAsia
5:44 pm on Aug 20, 2010 (gmt 0)
Turn off smart quotes in Word. (I assume WP has something like that as well, although haven't used it in years.) That's one of the first things I do every time I do with a fresh install of Office.
If you get Word documents from freelancers, you'll have to do a replace on the entire file before uploading.
jdMorgan
5:56 pm on Aug 20, 2010 (gmt 0)
When finished creating a document in Word, click "File" in the top menu bar, then "Save as" and choose "Plain Text (ASCII)." You will likely get warnings on the non-ASCII characters at this point. This would be a good time to globally search-and-replace them with the standard ASCII characters.
Also, under File -> Options -> Proofing -> AutoFormat, consider turning off the "Replace with smart quotes" and "Replace hyphen with dash" options. (This is the Word 2010 click-path; earlier versions are likely different).
Even with these changes, Word produces some fairly awful HTML with a lot of bloat. Consider using a good WYSIWYG HTML editor (many are free, such as SeaMonkey Composer, bundled with the SeaMonkey browser from Mozilla or Nvu, also a Mozilla Compser derivative).