[vox-tech] Special Character Issues in a web page

Micah J. Cowan micah at cowan.name
Wed Sep 20 11:56:40 PDT 2006


On Wed, Sep 20, 2006 at 10:06:04AM -0700, Richard S. Crawford wrote:
> This may be a dumb question, but can the backslash character be used to denote 
> special characters on a webpage under some circumstances in addition to the 
> ampersand?  I'm asking because as I review some of our old pages, some of our 
> Spanish text pages seem to use, say, \351 to refer to the accented o 
> character instead of ó or even &#351.  Strangely, when I worked on 
> these pages in a text editor, those characters were rendered as strange 
> characters, nothing like what they were supposed to be.
> 
> Anyone have any thoughts?

\351 in HTML can only represent the four characters, "\351". I strongly
suspect that it is in fact, one character, and certain text editors are
representing it using the string "\351". This suspicion is bolstered by
the fact that you've mentioned that some text editors display it as
garbled. Probably, those text editors were configured to interpret in a
different charset (UTF-8, most likely), and didn't know what to do when
they came across this ISO 8859-1 character.

Using character codes directly within the HTML is permissible, but to
work reliably the server needs to indicate the character set being used,
in its response headers (or, the HTML page itself can use <meta
http-equiv="Content-Type" ...>).

Another possibility is that it's not actually HTML, and is being
preprocessed into HTML, during which time escape sequences such as \351
are translated into the corresponding character. This seems less likely
to me.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


More information about the vox-tech mailing list