Live data from Hacker News

Some flag emojis aren’t working on Chrome on Windows

geyer.dev

11–20 of 328 posts

Re: Some flag emojis aren’t working on Chrome on Windows

#11
> 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

Wait. I thought Windows has ClearType which could render black text on white background using colors. And furthermore there is a wizard to allow users to adjust how much ClearType adjustment there is. This feels like a totally incorrect solution.

And apparently starting from 2021 Microsoft Edge did in fact begin to use ClearText according to this article https://blogs.windows.com/msedgedev/2021/06/02/improving-fon... from Microsoft. So the author's approach would be broken in Microsoft Edge since 2021.

Re: Some flag emojis aren’t working on Chrome on Windows

#12
post #6

Dumb decision from Microsoft. Will they remove country borders from Bing Maps because they might be considered political too?

You're not too far from the truth -- most mapping services render political boundaries differently based on where you're accessing the site from.

The Kashmir region north of New Delhi is an interesting example. Even in the US, Google basically says you're on your own, but here's a collection of dotted lines that may or may not be the actual borders.

Re: Some flag emojis aren’t working on Chrome on Windows

#13
post #6

Dumb decision from Microsoft. Will they remove country borders from Bing Maps because they might be considered political too?

You're not too far from the truth -- most mapping services render political boundaries differently based on where you're accessing the site from.

Or just refuse to commit. E.g. Google Maps, to this day, will not show the country for any Crimean city when you click on it to bring up its info panel. If you do this with e.g. Kherson, you get "Kherson, Kherson Oblast, Ukraine". But if you do it with Sevastopol, you only get the city name, not the region & country. It also shows dotted borders between Crimea and both Russia and Ukraine.

Re: Some flag emojis aren’t working on Chrome on Windows

#14
post #4

Presumably this is a big company problem of playing politics safely: They didn't want to take a position on the N country disputes out there by deciding which country code gets which flag and furthermore don't want to acknowledge which country politics are even disputed and so don't support the rest.

Microsoft has at least one maps product (Bing Maps), and at one time had an encyclopedia with an atlas. You’d think they’d have a way of dealing with disputed territory.

Re: Some flag emojis aren’t working on Chrome on Windows

#15
post #8

Dumb decision from Microsoft. Will they remove country borders from Bing Maps because they might be considered political too?

They removed country borders from the time zone selection in a Windows 95 update: https://devblogs.microsoft.com/oldnewthing/20030822-00/?p=42... In Bing Maps, I expect them change country borders based on localization settings, but that was probably too onerous to implement and test in the Windows 95 days.

I remember when this happened, which I guess makes me very old.

They didn't actually remove the map - they just removed any functionality it had. So the time set window is massive for no reason, it contains this huge world map bitmap that no longer does anything.

Re: Some flag emojis aren’t working on Chrome on Windows

#17
post #10

Since the article mentions using flags to represent languages, I feel obliged to point out that flags do not represent languages, so probably don’t use flags to represent languages.

But flags almost sometimes map roughly to languages within my limited experience! For example there's only one kind of English and it belongs to the USA. Also Spanish, that must be USA too, even if some unimportant countries speak it. Brazil can have Portuguese because I don't know where Angola is. The Indian flag can represent Hindi, but also the 22 scheduled languages, but not the other official language because I already allocated it.

This is going pretty well, but seems tedious, so for all other cases let's just merge ISO 3166-1 alpha-2 and ISO 639-1 as follows:

  SELECT 
    c.code AS common_code, 
    c.country_name, 
    l.language_name
  FROM iso_3166 c
  INNER JOIN iso_639 l
  ON c.code = l.code;
And if they don't speak Afrikaans in Afghanistan or Arabic in Argentina then you'll have to take it up with the International Organization for Standardization.

Re: Some flag emojis aren’t working on Chrome on Windows

#18
post #11

> 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 Wait. I thought Windows has ClearType which could render black text on white background using colors. And furthermore there is a wizard to allow users to adjust how much ClearType adjustment there is. This feels like…

The polyfill mentioned and linked in the article has a cleverer solution. It attempts to render the same flag emoji in two different text colors and checks if they end up being the same color or not (same color = probably a color glyph, ie an emoji).

https://github.com/talkjs/country-flag-emoji-polyfill/blob/5...

Re: Some flag emojis aren’t working on Chrome on Windows

#19
post #14
post #4

Presumably this is a big company problem of playing politics safely: They didn't want to take a position on the N country disputes out there by deciding which country code gets which flag and furthermore don't want to acknowledge which country politics are even disputed and so don't support the rest.

Microsoft has at least one maps product (Bing Maps), and at one time had an encyclopedia with an atlas. You’d think they’d have a way of dealing with disputed territory.

I'm sure they do have a way of dealing with it in Bing Maps - I assume they can display borders differently depending on the country of origin (I think that's the common approach), but that has zero technological overlap with the presence or absence of Unicode flag codepoints in a system-level font.
Post reply on HN