Help, said my friend,
my web page has gone all weird and I just don’t understand why.
I took a look, and could see why she was concerned. The first screenshot here shows the problem. In Safari all the HTML was showing, while Firefox had both the HTML code and weird question mark characters all over the place. 1
I Viewed Source on the page, but it all looked like a regular web page.
Then, interestingly, when I copied it all and pasted into BBEdit the ‘weird’ part of the code just didn’t come across. The framework page coding all pasted in just fine, but the part of the code displaying problems was just not there. Very weird.
I suspected what the problem was though — I’ve seen this before, though not recently. I had my friend email me a copy of the HTML page she had uploaded to her site.
It’s the gremlins
Once I received the original file I opened it in BBEdit and saw exactly what I expected: a whole bunch of upside down red question marks. These are what are known as ‘gremlins’. In fact these particular gremlins are a ‘null’ control character:
I don’t know how these control characters get themselves into the file, but in the last 10 years or so I’ve seen this a dozen times after a copy and paste.
I selected the
Zap Gremlins… item from the Text menu in BBEdit, selected the
Zapped Characters: Delete option and instantly all the red question marks disappeared.
Zap and they’re gone
After saving the file I viewed it again in the web browsers. This time it appeared as I expected.
If you’d like to take a look at this for yourself, download the Zipped file (4Kb) of 2 HTML files and take a look. But you’ll need BBEdit or another text editor capable of showing these ‘gremlins’. TextEdit.app, for example, won’t do it.
1 My friend’s actual web pages are behind a password, and for various reasons are not available for public view. The screenshots here are of a mockup I made to demonstrate the problem.