View Full Version : Decimal vs. Hex
techno_race
04-28-2007, 03:55 AM
For HTML character entities, overall, which is more widely supported? For example, the entities #65532 and #xFFFC both produce . Which is better to use?
I'll stick with decimal unless someone else says something.
Also, if it is something like:
- Opera supports hex but not decimal.
- Netscape and Mozilla support decimal and hex.
- Internet Explorer supports decimal but not hex.
could someone write a script that will find the browser and then choose for me with something like variables hex and decimal at the beginning so I can tell it the entities?
djr33
04-28-2007, 06:58 AM
Supported? Both....
I don't think it's much of an issue.
Named entities (© for example) are better so you know what they mean visually, rather than memorizing numbers, though.
Named entities are easier, then hex is marginally better than decimal, for the sake of a few characters spared. Nothing to get riled up about though.
mwinter
04-28-2007, 09:01 AM
As I recall, decimal character references have the best support across all browsers, even when compared to entity references. However, these days one can usually drop them entirely and use an appropriate UTF encoding scheme (-8 when mostly using the Latin alphabet, -16 otherwise).
Mike
mburt
04-28-2007, 12:24 PM
I ran into a problem when loading an html file onto my pocket pc, and it used © It displayed it exactly the way it is there, so I used decimal values and it worked. I'm not really sure why, but I think it had to do with the rendering engine.
pcbrainbuster
04-28-2007, 12:29 PM
Hex is supported in IE as far as I know...
mburt
04-28-2007, 12:31 PM
Both are supported in IE.
djr33
04-28-2007, 02:38 PM
Obviously IE supports all three ways. That's been implied with all the responses.
This discussion is practically theoretical and only applicable to really old or really simple offshoot browsers, like on cell phones.
IE, being the most widely used browser, defintely supports them all. And Firefox. And Opera. And Safari. And more. Only unusual browsers are questioned here.
techno_race
04-28-2007, 02:48 PM
Named entities are easier, then hex is marginally better than decimal, for the sake of a few characters spared. Nothing to get riled up about though.
?
Decimal = ᧝ ; (7) (had to add space because vBulletin changed it to the actual character :p)
Hex = ↭ (8)
for ↭.
:confused:
Not in all cases, but in some hex is more efficient. I forgot about the leading x, though: that mitigates the advantage.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.