2 ms·
You can even go a step farther; arguably, in a Unicode era, there is no such thing as "plain text" anymore. Nominally "plain text" has always had markup in it,
by jerf 1y ago
You can even go a step farther; arguably, in a Unicode era, there is no such thing as "plain text" anymore. Nominally "plain text" has always had markup in it, such as newlines, tabs, and so forth, but ok, sure, we can incorporate those things into what may be slightly misnamed but is a "simplest possible format" that had a lot of useful characteristics, like, it mostly fit into a grid (except tabs), it naturally fit with a monospace font, it could be dumped to terminal, it often had only 7-bit ASCII characters in it and if it was 8-bit the encoding was externally specified somehow, it is monochrome, etc. etc. There are some ways this strains the concept of "plain text" but when it wasn't a moving target for a couple of decades (modulo perhaps some 8-bit encoding issues) at least English speakers could pretty much agree on what "plain text" meant.
But even "plain text" unicode now breaks a huge number of those assumptions. A number of Unicode characters have defined widths, like all the spaces. Kanji is broadly defined to be twice the width of an English character in a monospaced font, and that's subject to a number of exceptions too. There are markup characters like Right-To-Left, Left-To-Right, and the Arabic Letter Mark. Emoji are not exactly intrinscally non-monochrome, but aren't exactly intrinsically monochrome either (your users may have some objections). Zero-width joiners have complicated semantics that go well beyond just "a zero-width space". You have to handle composite characters e + acute in addition to the e-acute itself, and you have to render arbitrary numbers of them to even remotely properly handle Zalgo text. You have to worry about font glyph support in a way that you didn't in a 256-character world.
Even text with no markup has mandatory markups in it now; they may not be "bold" or "italic" markup but if you want to even remotely properly render them the minimal code necessary to do so is rather more complicated than a minimal bold/italic support. Unicode doesn't really have that "we all agree on the defaults so we can just dump it to the screen and do the simplest possible render and we'll all agree that's what it should look like" anymore.