ASCII, Unicode and UTF-8: what is the difference?
ASCII is a repertoire of 128 codes. Unicode covers a much wider range of characters. UTF-8 encodes Unicode code points as bytes. None of these terms names a font or guarantees a drawing’s width.
Choose for your drawing
| Need | Choice | Check |
|---|---|---|
| TXT, terminal | ASCII | Espaces / spacing |
| ♥, ─, █ | Unicode + UTF-8 | Police / font |
| Visuel fixe / fixed image | PNG | Texte alternatif / alt text |
For a logo made of /, _, | and letters, ASCII is enough. For continuous frames using ─ and │, use Unicode and check the reader’s font. Choose according to the characters you need, not a format’s supposed prestige.
Characters and bytes: four concrete cases
| Text | Unicode | UTF-8 hex | Bytes |
|---|---|---|---|
| A | U+0041 | 41 | 1 |
| é | U+00E9 | C3 A9 | 2 |
| é | U+0065 + U+0301 | 65 CC 81 | 3 |
| ♥ | U+2665 | E2 99 A5 | 3 |
First case: A keeps the same numeric code in ASCII and Unicode and uses one UTF-8 byte. Second case: é can be represented by U+00E9 or by e followed by combining accent U+0301. Those two table rows may look identical while containing different code point sequences. You can reproduce the bytes using text.encode("utf-8") in Python.
for text in ["A", "é", "é", "♥"]:
print(repr(text), text.encode("utf-8").hex(" "))Why the counter and screen disagree
The ArtASCII diagnostic counts code points, not terminal cells. A combining accent can attach to the preceding character; some characters occupy different widths depending on the font and application. East Asian Width provides a classification, not a universal layout engine on its own. Do not therefore size a Unicode frame solely by string length.
Avoid common mix-ups
A .txt file can contain Unicode: its extension does not define its encoding. A monospace font does not convert ♥ into ASCII. Saving ASCII text as UTF-8 preserves those characters. Removing accents, however, changes the text; do it deliberately and keep the original. For a FIGlet banner, font coverage is a separate issue from file encoding.