[thelist] ASCii: html name vs html number

Andrew Clover and-evolt at doxdesk.com
Wed Nov 5 06:59:08 CST 2003


Brian Cummiskey <brian at hondaswap.com> wrote:

> I'm using an XHTML strict utf-8 charset, and I am wanting to use the ">>"
> character.

If you are definitely setting the charset so the browser can detect it,
(through HTTP or meta-element) you don't need to encode this, you can just
put in a literal >> character. (Assuming of course you have a decent text
editor that can save such characters as UTF-8.)

> According to a chart i found, &raquo; does the same thing as #&187 - one
> is the html name, one is the html number.

One is the HTML entity name, yes; the numeric character reference is
defined by XML as well as old-style HTML.

> Moreover, which is the more correct version to use, given my charset?

Either is valid and usually understood browsers. However if you want to
use simple XML tools that don't read the DOCTYPE external subset (or get
it wrong, eg. MSXML), &#187; is more likely to be understood.

The charset doesn't matter - when you're using a &#...; reference, it's
always a Unicode codepoint, independent of the document encoding.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


More information about the thelist mailing list