Welcome to WebmasterWorld Guest from 54.166.46.226

Forum Moderators: incrediBILL

Message Too Old, No Replies

HTML decimal alternative

When the decimal isn't recognized by the browser

   
3:04 am on Jun 25, 2014 (gmt 0)



When I last designed my site, I tried to minimize the use of images for the sake of speed. In doing so, I used several HTML decimal entities that I thought were universal, like:

►
▼

I recently discovered, though, that these aren't showing up in mobile browsers; all the user is seeing is an empty square.

I'd rather not replace these with images to do the same thing. I could realistically replace them with plain text (eg, ► becomes >), but I don't want to do that on all browsers for aesthetic purposes; I'd rather it be a last resort.

I could also replace them with pure CSS, but that's a lot of code to replace 7 little digits! LOL

Any other suggestions on how I might handle this?
3:22 am on Jun 25, 2014 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Using Icon Fonts.

[css-tricks.com...]
5:11 am on Jun 25, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



It's got nothing to do with recognizing entities. Mobiles simply don't come with as many fonts. If you require something that isn't built in, your only option is font embedding. Mobiles do seem to be OK with this; I had to do it on iOS 4 to get my non-English text to display.

decimal 9658, 9660
= hex 25ba, 25bc
= what the bleep? Can't you just use pointing fingers or something more widely available instead?

:: pause to swear at whatever idiot saw fit to destroy the Font Variation aspect of Character Viewer in 10.9 ::

If you need to embed a font, find a small one. Users on slower connections won't thank you if they have to download a 300k font file just to view a 10k page. Yes, there are single-glyph options, but it involves going to a third party. (Got a nasty feeling it's G###. I mean, who else would it be?) I prefer to edit font files so I'm just embedding the parts that are actually used.
8:11 am on Jun 25, 2014 (gmt 0)



Heck, I'm just using an Arial font! I thought it was universal, but I get squares on both iPhone's Safari, iPhones Google, and my default Android browser (whatever it is) :-(

I wish I'd realized this little issue earlier, but it didn't even cross my mind that mobile browsers wouldn't recognize it. I bet I have these two decimals in 250 different places throughout the site. Grr.
10:06 am on Jun 25, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



You may be using Arial for body text, but that doesn't mean every single character on every page is Arial. Your browser uses Font Substitution to find characters in other fonts when needed.

:: detour to detestable new Character Viewer ::

Those triangles are in Arial Unicode, but not vanilla Arial. (On my computer there are six Arials all told.) Also in Apple Symbols. The down-pointing one seems to have wider support.

:: further detour to test site and iPad ::

Both triangles display on iOS 7. (At a guess, using Apple Symbols.) Are your mobiles reasonably up-to-date?
1:44 am on Jun 26, 2014 (gmt 0)



Well, I made a discovery earlier today; changing ▼ to ▼ works on all of the browsers I could test with. So this must be an encoding issue.
4:14 am on Jun 26, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I'll be damned. I had no idea any browser distinguished between decimal and hexadecimal entities. I normally do use hexadecimal-- on the rare occasions I have to use entities at all-- but that's just because Character Viewer uses hexadecimal so it saves a step.

:: file and remember ::
4:29 pm on Aug 16, 2014 (gmt 0)

5+ Year Member Top Contributors Of The Month



So &#9660 should be supported by (almost) all browsers and devices, if using the right encoding, which may be UTF-8?
4:44 pm on Aug 16, 2014 (gmt 0)

WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month



No, I believe ▼ is the one that needed to be changed because it did not work on mobile browsers. A few posts back there is:
Well, I made a discovery earlier today; changing ▼ to ▼ works on all of the browsers I could test with. So this must be an encoding issue.
4:59 pm on Aug 16, 2014 (gmt 0)

5+ Year Member Top Contributors Of The Month



Ah, o.k., "encoding issue" is not clear to me, WHERE the issue is --> webmaster (GoNC) or browser of users

Probably you are right... really strange that there is such a remarkable difference for browsers regarding decimal and hexadecimal.
8:13 pm on Aug 17, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



if using the right encoding

The essence of entities that they work independent of the document's declared encoding. The encoding (various metas depending on whether you're in html 4 or 5, or a "charset" declared globally in config/htaccess) only affects the way the browser interprets the individual characters in the html file. Since entities only use ASCII characters, they are always the same.

Yes, the name "charset" is misleading. All browsers can display all characters. There's an arcane historical explanation which I have never committed to memory.