eli5 – What are zero-width characters?

141 views
0

eli5 – What are zero-width characters?

In: 2

Lol, did you see the steam post and could not understand what they were talking about?

They’re characters that do not take up any visible space when printed. For instance, Ctrl-G is the BEL character. Back when people connected to computers using teletypewriters, this character would tell the typewriter to ring a little bell that was attached to it. These days, some programs will activate a buzzer or make the screen flash when they see it, but most programs ignore it. Visibly, the character takes up no space.

Languages sometimes use a character in their digital text which does not take up any space when the text is printed on screen or on a page. For example, the Mongolian vowel separator “᠎” (code point 180E, HTML code ᠎), [which can affect how vowel signs look but does not itself have a glyph](https://linguistics.stackexchange.com/questions/12712/what-is-the-mongolian-vowel-separator-for).

Computers store text as a list of characters (thinks like letters, symbols, spaces, etc.) which are basically handled as a number code. For example, space is number 32.

There are a number of special character codes which control how text is processed but don’t actually show up. They are blank, but unlike a space, they don’t take up any space (in other words, their width is zero).

For example, code “200c” is the zero-width non-joiner character code. A computer stores this in the text to stop the next character joining to the one before (this is sometimes used in certain languages and fonts, where as an example an “a” can merge with an “e” to form a ligature such as in the word “encyclopædia” ).

These are commonly used to glitch programs, because computers often check names by just comparing the list of code numbers, so hello and hel”code 200C”lo look exactly the same on screen, but computer programs see them as different.