3 ms·
> unicode flags, for example don't make much sense with only one code point Complete tangent, but: To me, the Unicode flag codepoints aren't really "combining
by derefr 4y ago
> unicode flags, for example don't make much sense with only one code point
Complete tangent, but:
To me, the Unicode flag codepoints aren't really "combining codepoints with weird behavior" in the sense that e.g. a zero-width joiner is a combining codepoint with weird behavior; so much as they're a special alphabet that colors the text written in it as an ISO country code; where valid country-codes spelled out in that alphabet just happen to be ligature-rendered in a special way by font authors.
It makes just as much sense to have an isolated Regional Indicator Symbol Letter C (U+1F1E8) in text as it does to have an isolated regular C in text. (HN strips out the former, but it does have a visual representation!) In both cases, they're one letter of a "word", and don't make sense to use, but do make sense to mention. You can talk about "countries whose ISO country codes start with U+1F1E8" just like you can talk about "countries whose names start with C." This is unlike e.g. the individual surrogate-pair codepoints in UTF-16, which don't make sense to use nor mention on their own.
And it can also make sense to use the Regional Indicator Symbol Letters to spell out country-codes that don't exist, without the expectation that they'll be rendered as a flag at present; simply because you're adding a layer of semantic meaning to your text for machines (and potentially getting a future flag-symbol for humans as a bonus.) The meaning — "this text is colored to be an ISO country-code" — is still there, whether the text renders a flag or not. It's a forward-compatible encoding, in a way that "individual flag emojis for each country" wouldn't be.
Mind you, I'm on the fence about whether I like the Unicode Committee's choice to implement these codepoints as a special alphabet. On the one hand, I appreciate that these characters need to be their own set of semantically-distinct codepoints in some sense, so that there's no semantic ambiguity of these being interpreted by machine-parsers as "letters in a word", like there would be if these were letters spelled out in the Wingdings font. But on the other hand, would it have really hurt the design of Unicode so much to just come up with a semantic-meaning equivalent to the Variation Selectors, so that we could just use regular letters A+Z, plus a prefix codepoint on each that means "interpreted as an ISO country-code"? Semiotics Selectors, per se?