Decimal vs. hex for numeric character references

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

Harlan Messinger wrote:

Quoted text here. Click to load it

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:


    General Character Properties

      Unicode category: Letter, Lowercase

    Various Useful Representations

      UTF-8: 0xC6 0x80
      Octal escaped UTF-8: 60
      Decimal entity reference: ƀ

    Annotations and Cross References

        • 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+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

Re: Decimal vs. hex for numeric character references


Quoted text here. Click to load it

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

Site Timeline