With Unicode Hex Input, I can put glyphs with Unicode values of more than two bytes into my documents by entering four bytes with leading zeroes.

Flag emoji (and other things) are defined as the proper rendering of two adjacent five-nibble codes. When I type them into TextEdit, they do not combine. Other two-character items will render the first item when it is complete, but change it when the second is complete.

These particular items just show two unknown boxes when their codes are typed. But if I copy/paste the same flag from elsewhere, it is rendered correctly. When the source was a web page, "show source" gives an actual flag and not a numeric entity.


In my TextEdit in 10.13, I can get the French flag, which is 1f1eb 1f1f7, by typing the utf-16 for each of these separately with the option key held down, and they do combine:


(To find out character components of glyphs that display as a unit you can use the app UnicodeChecker)

| improve this answer | |
  • That's very interesting! Other characters of greater than U+FFFF I get with the actual Unicode (leading zeroes) but these require converting to UTF-16 instead. Not very convenient, but nice to know there's a way. And entering them that way shows the first glyph correctly instead of the "unknown" box. Also, when I save the file UTF-16, od -x shows them with the digits entered, no matter which way I (try to) enter them. Thanks also for the cool app. – WGroleau Feb 20 at 18:35
  • @WGroleau Could you explain the "leading zeros" method? I have always thought that entering the utf-16 was the only way to produce a character beyond FFFF with Unicode Hex input, as per earlier questions here like apple.stackexchange.com/questions/183045/… You may have made a new discovery. – Tom Gewecke Feb 20 at 18:52
  • Well, after more experimentation, my hypothesis is that when you put in five digits starting with '1', if the first four are a known code-point, that's the one you get. If not, you get the "unknown" box. But if you put in 0001 and then the other four, sometimes it works and sometimes it doesn't. Looking back, I see that it isn't much different from the old question I forgot about. :-) apple.stackexchange.com/questions/293308/… – WGroleau Feb 20 at 20:06
  • That wasn’t clear. If the first four are not a known Unicode, the five digits get the unknown block, but if the five are valid, sometimes the leading zeroes will work. So that is what I thought I observed. – WGroleau Feb 27 at 1:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .