Forum Moderators: open

Message Too Old, No Replies

HTML entity numbers or names?

         

Tonearm

5:56 pm on Mar 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Has anyone found any reason to prefer HTML entity numbers over names or vice-versa?

[w3schools.com...]

swa66

7:04 pm on Mar 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I strongly prefer the names: © is far less readable than ©

Tonearm

2:52 pm on Mar 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks swa66. It looks like ' doesn't work in IE according to the W3.

pageoneresults

3:02 pm on Mar 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I prefer numbers. Mainly due to working with FrontPage which likes to take named entities and convert them to their actual visual. I never liked that feature in FP. So, I use the numbered entities as much as possible. I believe they are also a little more reliable across multiple charsets?

encyclo

3:42 pm on Mar 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Both are sub-optimal solutions. Using © is better than
©
- if you use UTF-8. UTF-8 means you can simply use the actual character and not use entity references at all (apart from
&
).

Tonearm

3:29 pm on Mar 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a UTF-8 character for   ?

encyclo

3:52 pm on Mar 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a UTF-8 character for   ?

Yes - you can get it by typing Alt+0160 in Windows, for example. But it can be problematic in real-world use, you're better off using the entity reference in this particular case.

choster

11:13 pm on Mar 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If UTF-8 is not available to you, I do recommend named entities over numeric character codes. A human reading the markup can figure out the meaning more readily— you can probably figure out the meaning of — and ½ by looking at them, unlike — and ½, and even if you couldn't, you can at least tell them apart more easily.

The exception is if you are feeding the markup directly into an XML parser, which won't understand HTML entities unless you define them separately, in which case it might be easier to use the Unicode character reference to start with.