@gbarr Nice! I'm reading this on my phone, killing some time in the waiting room. And the nice thing about Go is, that I can use my phone's browser to copy and paste your function into the "The Go Playground" and see it working for myself. 👍

https://play.golang.com/p/Nmy3RYbs2NX

#golang #unicode

The Go Playground

Unicode is full of surprises. Ever wondered how to get the emoji flag for a given country. Unicode makes it simple

https://danq.me/2026/05/31/iso-country-codes-to-flags/

#unicode #golang #emoji

Converting ISO Country Codes to Flag Emojis

Did you know that there's a simple formula you can use to convert from an ISO two-letter country code to the emoji of the flag of that country. I've made an interactive thingy to demonstrate it, and shared some other fun things I've learned while playing around with ISO 3166 and flag emoji.

Dan Q

@lukeshu @SnoopJ

It seems that the Unicode code charts agree with you somehow ("preferred representation" is ambiguous though, it possibly just means which other character the glyph should be replicated from):

U+2126 OHM SIGN
* SI unit of resistance, named after G. S. Ohm, German physicist
* preferred representation is U+03A9
x (ascending node - U+260A)
: U+03A9 greek capital letter omega

https://www.unicode.org/Public/17.0.0/charts/CodeCharts.pdf

#Unicode #CodeCharts #Glyphs

I could probably go look up some historical rationale, but rn I just need to gripe:

U+2126 "OHM SIGN" shouldn't exist. We should just use U+03A9 "GREEK CAPITAL LETTER OMEGA".

What's next, "METER SIGN" instead of just using U+006D "LATIN SMALL LETTER M"‽

#Unicode

All occurrences of code points are "normalized", using the unambiguous standard #Unicode notation with "U+" added before the 4 to 6 hexadecimal digits. All code point ranges are also "normalized", making use of the standard #Unicode separator ".." between the first and last code points.

Identification (parsing) of code points is now straightforward, so backslash-escaped numeric values are no more needed for annotations in the Egyptian Hieroglyphs blocks, and are also "un-escaped".

OK, so new official release for #EmojiGear, the #Amiga #amigaOS3 #Unicode text editor with colored emojis, antialiased fonts and modern text editor features. it's version 2.3, and you officially need a AmigaOS3.2 to run it. Hopefully also on Aminet soon.

https://github.com/krabobmkd/EmojiGear/releases/tag/tr2.3

Release EmojiGear r2.3, Amiga Unicode Text Editor, with gadgets · krabobmkd/EmojiGear

EmojiGear is a UTF-8 Unicode text editor for AmigaOS 3.2.x (68020+). It renders TrueType/OpenType fonts and displays full-colour Emoji, on any Amiga Video mode, native or RTG, indexed or true color...

GitHub

The #Unicode #codecharts are an amazing wealth of information. Apart from the representative glyphs which are nowhere else available, they can help to establish some kind of #taxonomy based on the names of #blocks and #subheaders, and also provide useful #annotations for #characters, creating #crossreferences between them.

🔗 https://www.unicode.org/Public/17.0.0/charts/CodeCharts.pdf

However, extracting this information from the NamesList.txt data file used to generate the charts proves to be uneasy…

🔗 https://www.unicode.org/Public/17.0.0/ucd/NamesList.txt

TIL that you can convert a two-letter ISO country code into the emoji of the flag of that country like this (I'll use France [FR] as an example):

1. Get the ASCII character code of each letter: F = 70, R = 82.
2. Add 127,397 to each; now you have F = 127,467 and R = 127,479.
3. Use those as unicode codepoints (🇫 🇷)
4. Concatenate both to get the emoji: 🇫🇷

Magic! 🤩

🔗 More about how this works, plus an interactive to play with - https://danq.me/iso-country-codes-to-flags

#iso3166 #iso #standards #unicode #emoji #flags

Converting ISO Country Codes to Flag Emojis

Did you know that there's a simple formula you can use to convert from an ISO two-letter country code to the emoji of the flag of that country. I've made an interactive thingy to demonstrate it, and shared some other fun things I've learned while playing around with ISO 3166 and flag emoji.

Dan Q

Did you know that there's a simple formula you can use to convert from an ISO two-letter country code to the emoji of the flag of that country. I've made an interactive thingy to demonstrate it, and shared some other fun things I've learned while playing around with ISO 3166 and flag emoji.
Read more: https://danq.me/2026/05/31/iso-country-codes-to-flags/

#article #emoji #flags #golang #standards #unicode

Converting ISO Country Codes to Flag Emojis

Did you know that there's a simple formula you can use to convert from an ISO two-letter country code to the emoji of the flag of that country. I've made an interactive thingy to demonstrate it, and shared some other fun things I've learned while playing around with ISO 3166 and flag emoji.

Dan Q

There is a entry in the #Unicode #CodeCharts which has been puzzling me since a while ago, both in the English and French version:

10F45 SOGDIAN INDEPENDENT SHIN
→ 6240 所

10F45 CHINE INDÉPENDANT SOGDIEN
→ 6240 所

Fortunately, I was able to find some explanation in the #CoreSpec - Chapter 14:

"The repertoire includes one phonogram, U+10F45 𐽅 SOGDIAN INDEPENDENT SHIN, an alternate form of isolated shin, used to transcribe one Chinese character, U+6240 所."

Now, I can die in peace…

#Sogdian