DEV Community

Daniel Pertu
Daniel Pertu

Posted on

Our 79-page site is written in 98 distinct characters, and six of them are an empty table header

I fetched all 79 URLs in our sitemap, stripped the scripts and styles, and counted every character of visible text. 386,063 characters. 98 distinct codepoints. That is the whole alphabet of a commercial website: 58 letters, 10 digits, 28 punctuation and symbol characters, and 2 kinds of space.

The non-ASCII half of the inventory is short enough to print in full:

codepoint character occurrences where
U+00A9 © 79 the footer, once per page
U+2192 → 34 link labels on 4 pages
U+00A3 £ 25 4 pages
U+201C / U+201D “ ” 11 + 11 the terms only
U+00A0 no-break space 6 one per comparison page
U+00E9 é 6 question pages
U+20AC € 5 3 pages
U+00D7 × 4 one guide
U+00ED í 3 question pages
U+2026 … 3 the homepage
U+2019 ’ 2 one tool page
U+00EB ë 2 question pages
U+00F3, U+00E1, U+00F6 ó á ö 1 each question pages

Sixteen characters, 185 occurrences, out of 386,063. Everything else is ASCII.

The two dashes that are not there

hyphen-minus U+002D   469
en dash      U+2013     0
em dash      U+2014     0
Enter fullscreen mode Exit fullscreen mode

We have a house rule against em dashes in user-facing copy. No linter enforces it, no test checks it, and across every page of copy it holds exactly: the character does not occur anywhere on the site, and neither does its shorter cousin. The hyphen does all the work, 469 times.

That is the most useful thing about a character census. A written-down rule shows up as an exact zero, and a rule that only lives in somebody's head shows up as a distribution.

261 straight apostrophes and two curly ones

'  (U+0027)  261
’  (U+2019)    2
Enter fullscreen mode Exit fullscreen mode

Two of 263 apostrophes on the site are typographic, and they are not in anything a person wrote as copy. They are in team names on the team name generator: "Dumbledore’s Army" and "Agatha Quiztie’s Understudies". The list of 110 names was typed in a different session, in a different mood, from the page copy around it.

Double quotes split the same way and more cleanly:

"  (U+0022)        46   page copy
“ ” (U+201C/201D)  11 pairs   /legal/terms only
Enter fullscreen mode Exit fullscreen mode

The legal document is the one place with real quotation marks, because it was drafted as a document and pasted in. Every other quoted phrase on the site is a programmer's straight quote.

The six non-breaking spaces are a bug I found twice

One per comparison page, six in total, and this is the context:

...hard or impossible on a phone.\xa0PubTriviaPen and paper...
Enter fullscreen mode Exit fullscreen mode

That is the join between the last paragraph and the comparison table's header row, which means the non-breaking space is the table's corner cell:

<th scope="col" class="text-foreground p-4 font-semibold">&nbsp;</th>
Enter fullscreen mode Exit fullscreen mode

I found the same cell this morning from a completely different direction, by running axe-core against all 79 pages, where it is the empty-table-header violation on six pages. A column header whose accessible name is a space, written as a non-breaking space so the cell would not collapse visually.

Two audits, two methods, one character, and the fix is the same: make the corner a <td>.

The arrow is part of 34 accessible names

All 34 right arrows live inside anchor text, never beside it:

So the accessible name of a feature link is literally More on per-question timers →, with the arrow in it. Screen readers differ on what they do with U+2192: some say nothing, some say "right arrow", some say "rightwards arrow". None of them say "and the link continues", which is the thing the glyph is there to imply.

The six identical The longer comparison → links on one page are a separate problem I have written about before: same text, six destinations. The arrow at least makes it obvious that the label was designed to be read visually.

Three ellipses, one page, and no three-dot imitations

… (U+2026)  3   all on the homepage
"..."        0   anywhere
Enter fullscreen mode Exit fullscreen mode

All three are in the demo copy on the landing page, where the host screen is waiting for something: a team to join, a question to start, the others to answer. Whoever typed those typed the real character, and nobody anywhere on the site typed three full stops instead. For a codebase with one author that is a coin flip that came up the same way three times.

The inventory depends on where you are standing

The pound sign is on 4 pages, 16 of its 25 occurrences on the profit calculator. The euro sign is on 3, including the homepage, because prices are localised at the edge from the request's country.

Which means this census is not a property of the site, it is a property of my request. Our price table covers 24 currencies, so a visitor elsewhere sees characters this inventory does not contain: the yen sign, the shekel, the Icelandic króna. Two of those currency strings even carry invisible direction marks. If you want the real character inventory of a localised site, you have to fetch it from every market you sell in.

What the browser does with all 98

In the delivered HTML, React escapes the ones that matter: 261 &#x27; for the apostrophes, 46 &quot;, 225 &amp;, two &gt;, and zero &nbsp;, because the six non-breaking spaces ship as literal UTF-8 bytes rather than entities.

And then every one of the 98 is drawn by a font we do not ship. I found out this morning that our font-sans utility resolves to the system stack, so the accented letters on the question pages, the arrows in the link labels and the two curly apostrophes in the team names are all rendered by San Francisco, Segoe UI or Roboto depending on who is reading.

Which makes the character inventory the only typography decision on this site that actually reaches a screen. It is 30 lines of Python to run against your own site, and it tells you things no style guide will.

Top comments (0)