SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)

    ★ in IE 9-

    So, Any work around to the fact that IE doesn't get the newer HTML special character glyph ★ ?

    I'm thinking of using some form of Java Script fix will be needed, but if there's something I can do without resorting to JS I'm all ears.

    (Note, IE 10 is fine, so any fix must not affect IE 10 or later)

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,263
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Numeric entities always work.



    Off Topic:

    SP's entity escaping seems a bit buggy.
    "First make it work. Then make it better."

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The Black star ★ U+2605 ★ for vBulletin use HEX 'numerical character reference' in vBulletin and it will display.

  4. #4
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    The Black star ★ U+2605 ★ Jeff for bulletin use 'numerical character reference' for the ampersand & in vBulletin and it will display.
    Uh, that's a bit of my fault, I tried to correct Jeff's slightly broken code and managed to completely ruin it, was hoping I could invisibly mend it before anyone noticed but apparently not :-(

    The problem with using & to code an & is that as soon as you go to edit or quote it, it reverts back to being a plain & so you lose whatever you were trying to do, as it has done here. The easiest way to spell out an entity is to break it up with code, something like &[b][/b]nbsp;.

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    There is another way of doing it apart from Hex, though at the moment I have forgotten... I did having it working then it reverted.

  6. #6
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,263
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    for vBulletin use HEX 'numerical character reference' in vBulletin and it will display.
    I'm glad there's a workaround. Is there any interest in fixing vBulletin to behave consistently in the first place?

    The way it seems to work right now is:

    If I type & # 9733 ; then the ampersand is not escaped, and the entity renders. -> ★

    OK, I think, if ampersands aren't escaped, then perhaps I can type & amp ; #9733 ; But no, because in this case, it seems, the ampersand is escaped. -> ★

    The ideal would be if ampersands were always escaped. After all, they're a special HTML character, just like < and >. But if for some reason that's not possible, then it would be super nice if it were at least consistent. Either they're always escaped or always not.
    "First make it work. Then make it better."

  7. #7
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    NCRs (numeric character references) and 'character entity references' are types of character escape used in markup. Getting back to the question NCR is the preferable choice over the entities, entities are limited to a subset of Unicode characters, NCR can specify any character and theoretically Hexadecimal has less ambiguity.

    <ot>Going back into the SPF archives over the forum weirdness; post #6 onwards: Ampersand Confusion: "cannot generate system identifier for general entity"</ot>

    Off Topic:

    Yes, editing the post #3 made things go wonky for me. Hence why my post differs in Stevie's QUOTE because I was still fiddling to tame the damn beast, as editing resulted in it parsing the characters differently each time.

  8. #8
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,263
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    NCRs (numeric character references) and 'character entity references'...
    Oops. I had the wrong terminology. I mistakenly called it a numeric entity.

    NCRs (numeric character references) and 'character entity references' are types of character escape used in markup. Getting back to the question NCR is the preferable choice over the entities, entities are limited to a subset of Unicode characters, NCR can specify any character and theoretically Hexadecimal has less ambiguity.
    Fantastic post!
    "First make it work. Then make it better."

  9. #9
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    There is what are called: Character Entity References and Numeric Character References nearly everyone gets it wrong. EXTREME AWXSOME danger levels.

  10. #10
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    NCRs (numeric character references) and 'character entity references' are types of character escape used in markup. Getting back to the question NCR is the preferable choice over the entities, entities are limited to a subset of Unicode characters, NCR can specify any character and theoretically Hexadecimal has less ambiguity.
    On the other hand, I can remember lots of entity names, but trying to store all those NCRs in my head isn't going to work, so from that point of view it is much easier, for those characters, to use named entities rather than have to look up the NCR every time!

  11. #11
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Now, if you wanted to avoid having to enter certain entities you may want to save as UTF-8 so you could input the special character directly.

    NCR as explained are more functional. HTML 4.01 has 252 Character entity references: http://www.w3.org/TR/html401/sgml/entities.html For X(HT)ML an application of XML, we have the XML specification that defines five "predefined entities" only: http://www.w3.org/TR/REC-xml/#sec-predefined-ent hence NCR should only be used if authoring XHTML and not using one of those 5 and HTML 4.01 only has 4 of those.

    Numeric character references, both decimal and hexadecimal, can be safely used in (X)HTML and XML, but you need to be careful that you're referencing the character's code point from the Unicode character repertoire, not Windows-1252.

  12. #12
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone.

    While I was away I changed my mind on how I wanted to do this effect and chose a set of buttons in a JS interface.


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
  •