Where a Missing Accent Can Go Wrong on Screen

The accent over é can disappear from a screen even when the intended letter is still in the text. A font may lack the shape needed to display it, or the software may have read the stored bytes using the wrong encoding and never arrived at é in the first place. A box in the middle of a word is a symptom. By itself it cannot say which part of that chain went wrong.

Cool daylight falls across the back of an open grey laptop and its softly blurred keyboard on a dark desk mat.

What does a box in the middle of a name show?

An empty square where there should be a letter is familiar enough to have an air of explanation about it. It is easy to think of it as the screen's verdict on a damaged file. The World Wide Web Consortium's Internationalization group makes a narrower point in Character encodings for beginners: when a font lacks a glyph for a character, some applications search other fonts, while a box, question mark or another stand-in may appear if the shape is unavailable. What the screen supplies is a visible substitute. It has not necessarily lost the character it was asked to draw.

A stand-in can be less obvious than a box. A letter with a visibly different stroke or shape from the rest of a word may have come from a fallback font. If the underlying character was decoded correctly, that mismatch in style is a display difference. The reader may still recognise the name. If the bytes were decoded as a different character, the screen might show a perfectly crisp and plausible letter in the main font, yet the name would be wrong. A tidy appearance offers no guarantee that the right mapping was used.

An ordinary e where an é belongs poses a separate question. It may simply be the character that was entered or saved. Treating every such case as a failed font would put the investigation at the wrong end of the chain. The screen alone cannot tell what was originally entered, what survived saving or what the app eventually drew.

What a visible symptom leaves unresolved

On screenOne possible explanationStill to establish
Square in a nameThe renderer has no suitable glyphWhich character the app decoded
Letter in a different styleAnother font supplied the glyphWhether the intended character survived
Clearly drawn but unexpected letterBytes were read with a different mappingWhich encoding was used to save and read the text

What is stored before the font gets involved?

Text has a character layer and a byte layer. A character is the unit the text is meant to contain, such as a particular letter. A code point is a number used to identify a character in a coded set. An encoding specifies how the character information is represented as bytes. When software reads text, it uses that mapping to turn the bytes back into characters. Only after that does the renderer have characters to hand to the font system.

The Consortium's example puts a number to the distinction. In ISO 8859-1, also called Latin1, the code point for é is decimal 233. In that encoding the letter is stored as a single byte with that value. In ISO 8859-5 the same byte value corresponds to щ, a Cyrillic letter. If the first mapping was used to write the byte and the second to read it, an application can receive щ where é was intended. A font that draws щ accurately has done its part correctly; the error happened upstream.

In Unicode, those letters have separate code points. The Consortium gives U+00E9 for é and U+0449 for щ. UTF-8 is an encoding for Unicode text, and both characters take two bytes in that encoding. The decimal number 233 in the Latin1 example does not therefore describe a single universal byte for é. The representation belongs to a particular encoding, just as the appearance of the letter belongs to a particular rendering.

From stored text to the screen

  • Saving: an encoding represents the characters as bytes.
  • Reading: the application interprets those bytes using an encoding.
  • Rendering: the application finds glyphs for the decoded text in the available fonts.

Can two identical-looking accents have different data behind them?

The Unicode Consortium's Unicode Normalization Forms makes a further distinction: some visible characters can be represented in equivalent ways. An é can be represented by a precomposed character, or by a base e followed by a combining acute accent. Under canonical equivalence those represent the same text; when rendered correctly they should look the same. The underlying sequences can nevertheless differ.

That example starts with text that has been decoded correctly. It is not a case of an encoding mistake turning é into щ. Nor does changing from the composed form to the decomposed one mean throwing the accent away. The mark remains present in the second form as a combining character. A visual match tells a reader what the two examples look like on that screen. It does not settle whether the underlying sequences are identical.

This matters when comparing two apparently identical labels. A comparison based on exact stored sequences answers a different question from one that takes canonical equivalence into account. Normalisation gives equivalent Unicode text a consistent form for such a comparison. It cannot generally reconstruct the intended text after the wrong decoding has already been applied, or supply a shape that the available fonts cannot draw. Those are faults at other stages.

Why does a change of setting sometimes change the symptom?

Changing an encoding declaration changes how software is told to interpret the bytes. It does not rewrite the file. A document declared as UTF-8 and a document actually saved as UTF-8 are therefore two different things to establish. If they disagree, the remedy depends on the intended interpretation and what happened to the data since it was written. A new label cannot restore bytes that were already replaced in a saved copy.

Changing a font, by contrast, can change what appears even with exactly the same decoded text. An accented letter that appears after a font change is consistent with a glyph coverage problem. A font change can also make a wrongly decoded character more legible without making it the right character. For a comparison across displays, the useful controls are the same source file, the same encoding interpretation and a note of the application and font settings in use. A comparison based only on what two screens seem to show leaves those conditions unknown.

The difference matters when a screenshot is the only record. A screenshot preserves the drawn result, including the box, fallback letter or missing mark. It contains no record of the original bytes or which character the application handed to its font. Two displays can disagree while reading the same data; they can also appear to agree while concealing different underlying sequences. The visible word is a starting point for tracing the failure, not a substitute for the original text.

Where does a copy of the word fit into the chain?

Text copied from the display, where the application permits it, offers a different comparison from a screenshot. The first application might show a box, while text copied into a second application still contains the intended é. If that application can draw é, the two views are consistent with the character having survived and the first display being unable to render it. If the copied text contains щ, the second application can faithfully draw the same unintended letter. It has received text after the first application interpreted the stored bytes.

Copying adds a boundary of its own, since the second application receives whatever the first one exports. That is why a comparison of copied text and an examination of the original bytes answer different questions. The former can help distinguish a drawing problem from a character substitution in a given view. The latter is needed to establish which interpretation fits the saved data. Before comparing results across versions of an application, it matters which of those two comparisons was actually made.

If the same word appears in a document and in an exported copy, it matters which file produced the screen under discussion. A character that was decoded wrongly and then saved can become the actual text in the new file. Showing that the new file is correctly encoded says only that it preserves the characters it was given, even if those characters were already wrong.

A comparison that isolates the display

  • Same source file and same copy of the text
  • Same interpretation of the stored bytes
  • Application and font settings recorded separately
  • Visible glyph compared with the decoded character, when available

Frequently Asked Questions

Can a font change recover an accented letter?

It can make a character visible if that character was decoded correctly and the previous font could not represent it. If the underlying text actually contains a different character, a different drawing of that character does not restore the intended letter.

Is a question mark always evidence of a missing font glyph?

A question mark can appear as a substitute when no suitable glyph is available. Its appearance cannot establish whether it was drawn as a fallback or was already part of the text delivered to the renderer.

Does declaring UTF-8 convert an old file to UTF-8?

A declaration tells the reader of a file which mapping to use. The bytes still need to have been saved using that encoding for the declaration to describe them correctly.

Does one visible accent always correspond to one code point?

An accented form can be made with a base letter and a combining mark. In the case of é, a precomposed form also exists, so counting visible letters does not settle how many code points were used.

Can surrounding English text look fine when one character is wrong?

It can if the encodings in question agree on the bytes used for the surrounding letters but differ on the byte or sequence used for the accented one. The affected word can therefore be the first visible clue even when the rest of a line looks ordinary.

Sources

  • World Wide Web Consortium Internationalization — Character encodings for beginners
  • Unicode Consortium — Unicode Normalization Forms
  • Unicode Consortium — Unicode Character Database: UnicodeData.txt