Decimal vs. hex for numeric character references

Decimal vs. hex for numeric character references

am 19.11.2007 14:45:20 von 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?

Re: Decimal vs. hex for numeric character references

am 19.11.2007 16:34:31 von Toby A Inkster

Harlan Messinger wrote:

> 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/

Re: Decimal vs. hex for numeric character references

am 19.11.2007 17:20:03 von Andy Dingley

On 19 Nov, 13:45, Harlan Messinger
wrote:

> 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.