user380303
user380303

Reputation: 1171

What is the difference between the HTML codes Numeric and Friendly?

This page -- http://webdesign.about.com/od/localization/l/blhtmlcodes-punc.htm -- shows a list of HTML characters that can be rendered with either numeric codes or friendly codes. What is the difference between the two codes? Will some browsers render the codes differently? Are the numeric codes more dependable and should therefore be the standard in HTML, XHTML, XML, etc.?

Thanks

Upvotes: 1

Views: 249

Answers (2)

Aaron Digulla
Aaron Digulla

Reputation: 328860

No but in some circumstances, you will prefer one over the other.

If you generate HTML from Unicode, you don't want to remember all the nice entity names. Instead, you will always generate a numeric character entity.

If you write HTML code manually, you'll probably want to see right away what character this will become. Here, you will prefer the symbolic name.

For the HTML parsers, it doesn't make a difference. There is a standard which enumerates all the symbolic names plus a DTD file which contains them, so that's not a problem.

For XML parsers, things are a bit different. They don't know HTML entity by default. So you will have to add those. If you can't, then you will prefer HTML code that only contains numeric entities because any other input will make your code fail.

Upvotes: 1

Cobra_Fast
Cobra_Fast

Reputation: 16111

You simply cannot display all the available characters with "friendly" character sequences.

Upvotes: 0

Related Questions