6 ms·
> My approach was to draw an American flag emoji and then look at the pixels to see if any of them contained a non-grayscale color. This works because the Windo
by hunter2_ 2y ago
> My approach was to draw an American flag emoji and then look at the pixels to see if any of them contained a non-grayscale color. This works because the Windows fallback emoji is just black/white text
This is the kind of thing that works great for a while, and then an OS update flips the table on how RGB subpixel antialiasing works for the subset of your users with a certain type of display, leading to a false positive all of a sudden.
Chrome could at least expose support like other feature detection APIs, even if they don't go so far as to provide the flags, to avoid this ridiculous heuristic approach.
Aside: my personal belief is that the political charge here lies with Unicode having codepoints for such countries, and downstream dependents of Unicode can readily point the finger. Displaying monochrome text of a country abbreviation instead of a flag doesn't seem like it would appease those who don't want the country acknowledged, anyhow; a "missing glyph" type of thing would come closer.
- scrollaway 2y agoUnicode doesn’t have codepoints for any of these. Unicode has defined a singular generic way to transform iso country codes (not even — just two of any characters), and says it’s how you do flags.
- rozab 2y agoNo, unicode define the region subtags here https://github.com/unicode-org/cldr/blob/maint/maint-41/common/validity/region.xml https://github.com/unicode-org/cldr/blob/maint/maint-41/comm... You can see the country names alongside the codepoints here, ctrl+f for 'taiwan' and 'palestinian territories' https://unicode.org/Public/emoji/latest/emoji-sequences.txt https://unicode.org/Public/emoji/latest/emoji-sequences.txt
- dgfitz 2y agoI welcome the day I can identify my home as a territory and have it legally recognized. Who exactly decides this, in the actual code?
- lifthrasiir 2y agoSubtags are derived from ISO 3166-2, so you want to contact its maintenance agency.
- andreareina 2y agoIIRC someone else started it by applying a ligature to the appropriate regional indicator pairs, then Unicode adopted it.
- deleted 2y ago[deleted]
- WorldMaker 2y ago> Aside: my personal belief is that the political charge here lies with Unicode having codepoints for such countries, and downstream dependents of Unicode can readily point the finger. Displaying monochrome text of a country abbreviation instead of a flag doesn't seem like it would appease those who don't want the country acknowledged, anyhow; a "missing glyph" type of thing would come closer. Flags are Political Symbols. ISO Country Codes are not. People rally around flags. Flag color symbolize beliefs/ideals. Flag crests and images contain political messages. ISO Country Codes are just a couple of letters that might (but not necessarily do) reflect a Country Name. It's generally not just "don't want the country acknowledged", it's "don't want dissidents rallying to that flag". For instance, the parts of China that believe Taiwan is and always shall be a part of China don't have a problem with naming Taiwan as such, they see that as the "province name"; they do have a problem with the national flag of Taiwan, which intentionally represents and symbolizes its independence from China. I can't blame Microsoft for not wanting to support flags. Politics are hard. Flags can be the hard mode of Political Symbols. (Also Microsoft's stance is interesting in the way that it came from that Windows 95-era map-based Time Zone picker. The number of lawsuits they had over effectively "single pixel" border disputes was absurd. Flags are way more political than borders.)
- themacguffinman 2y agoI can blame Microsoft. Every other tech company and OS figured out how to make it work and they're not exactly buckling under the weight of legal or political pressure on the matter of flags.
- WorldMaker 2y agoIf you had the choice between "no lawsuits at all" and "lawsuits in random months by random countries for things that can escalate to violence and wars" you wouldn't take "no lawsuits at all"? Even if very few of the lawsuits actually escalate to violence or war, is any risk of violence/war worth it? Ethics would suggest "all my competitors are doing it" isn't a great answer here, either, and certainly doesn't remove the risk. I can respect the "no lawsuits at all" preference here.
- wongarsu 2y agoUnicode's mission is to be able to represent all written text. Once you decide that flags should be part of that you kind of have to include all of them. Including a flag in Unicode isn't a statement that you believe that this country exists, it's a statement that you think there are people who use this flag in written communication.
- hunter2_ 2y agoRegardless of what the upstream rebuttal is (i.e., Unicode's mission as you explained), I think it makes sense for the downstream entity (i.e., Windows) to simply indicate inheritance from upstream as a rebuttal to any pressure.
- int_19h 2y agoIt doesn't matter what you think the statement is. What matters is what the governments around the world, and specifically in places where you're selling your products, think it implies.
- Someone 2y ago> Unicode's mission is to be able to represent all written text. Once you decide that flags should be part of that you kind of have to include all of them. Unicode has decided flags shouldn’t be part of Unicode. There are a few flag emoji that got included before they reached that decision and there are “regional indicator symbols” that often get displayed as flags, but that’s it. They won’t, for example, include flags of cantons of Liechtenstein. See https://blog.unicode.org/2022/03/the-past-and-future-of-flag-emoji.html https://blog.unicode.org/2022/03/the-past-and-future-of-flag....