Decimal vs. hex for numeric character references

H

Harlan Messinger

The Unicode code charts present all characters with their hexadecimal
representations, but then people seem to tend to use the decimal
representations when they use numeric character references in their web
pages. Is my impression correct? If so, how is it that people came to
prefer having to convert between representations every time they looked
up the code for a character rather than just using the hex
representation directly and sticking an "x" between the pound sign and
the number? For example, the em dash is listed as character 2014(hex).
Why did people decide to use — instead of using — directly?
 
T

Toby A Inkster

Harlan said:
The Unicode code charts present all characters with their hexadecimal
representations, but then people seem to tend to use the decimal
representations when they use numeric character references in their web
pages. Is my impression correct?

AIUI, decimal codes have slightly better support in some very old
browsers. I tend to use decimal, but occasionally use hex. It's the
decimal codes for commonly used character references that seem to have
stuck in my head though -- I can reel off the decimal values for the
various curly quotes, dashes and so forth, but couldn't list the hex
off the top of my head.

Also, FWIW, I tend to look up unknown character codes in gucharmap (GNOME
Unicode Character Map) which gives character details like so:

Æ€
U+0180 LATIN SMALL LETTER B WITH STROKE

General Character Properties

Unicode category: Letter, Lowercase

Various Useful Representations

UTF-8: 0xC6 0x80
Octal escaped UTF-8: \306\200
Decimal entity reference: ƀ

Annotations and Cross References

Notes:
• Americanist and Indo-Europeanist usage for phonetic beta
• Americanist orthographies use an alternate glyph with the stroke
through the bowl
• Old Saxon

See also:
• U+03B2 GREEK SMALL LETTER BETA
• U+2422 BLANK SYMBOL

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 12 days, 22:22.]

USD/EUR Exchange Rate Graph
http://tobyinkster.co.uk/blog/2007/11/18/usd-eur/
 
A

Andy Dingley

they use numeric character references in their web pages.

The PC-AT numeric keypad "Alt-0176" trick uses decimal numbers, not
hex, so I know a lot of them by heart when I don't know the hex
equivalents.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top