Unicode Flags

Screen capture of the page displaying regional indicator flags

One entry of this blog that gets some traffic is about emoji flags (in French). It explains how these flags are encoded in Unicode, instead of a single character per flag, there is a special range of letters, and when a region’s ISO 3166-2 code is written with these letters, the operating system’s font might replace the two letters of the code with a flag. As these letters have code-points above 0xffff, they are in turn represented by two chars on systems that encode text as UTF-16, like for instance Java, so a single flag will look to older code as four characters.

When I wrote the article, the supported national flags were basically those present in the proprietary encoding of Japanese mobile phone operators, as the whole emoji project was first about providing compatibility with these systems. So the French flag would display, but not the Swiss one.

Meanwhile things have changed and emoji has taken its own life and is increasingly adopted outside of Japan and the support in operating systems was greatly improved: on Mac OS X, the Swiss flag is also displayed. This led me to wonder to what extent flags of the regional indicator ranges were supported nowadays.

So I generated a page from the list of iso 3166-2 country codes with for each country the region code encoded using the regional indicator characters, that display for a given browser while flags are handled. On Mac OS X, Switzerland now has its flags, the Republic of Chad does not. Many micro-states (Vatican, Monaco) don’t have their flags yet. Taiwan is also missing; given Apple’s focus on mainland China, this is hardly surprising. Android has no such problem…

One thought on “Unicode Flags”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.