Results 1 to 10 of 10

Thread: Decimal vs. Hex

  1. #1
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default Decimal vs. Hex

    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?
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I ran into a problem when loading an html file onto my pocket pc, and it used &copy; 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.
    - Mike

  6. #6
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hex is supported in IE as far as I know...

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Both are supported in IE.
    - Mike

  8. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  9. #9
    Join Date
    Feb 2007
    Location
    🌎
    Posts
    528
    Thanks
    10
    Thanked 10 Times in 10 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by Twey
    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 = &#6621 ; (7) (had to add space because vBulletin changed it to the actual character )
    Hex = &#x21AD; (8)
    for ↭.
    ....(o_ Penguins
    .---/(o_- techno_racing
    +(---//\-' in
    .+(_)--(_)' The McMurdo 500

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Not in all cases, but in some hex is more efficient. I forgot about the leading x, though: that mitigates the advantage.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •