By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SOLVED! Emoji flipping & coloring - rainbow trumpets facing both directions!

So, I'm trying to learn how to flip emoji.
I was provided a solution for PowerShell that I can't quite get working in TCC.

The code is:

printf '\eP0;8;1;10;0;2;20;0{ @???~}{wo_?/[MFJp@@@@@/GCA@??????/??????????;?_ow{}~???/@@@@@pJFM[/??????@ACG/??????????;??????????/??_ogKYr}{/?_ow\\NVb`O/@B@???????;??????????/{}rYKgo_??/O`bVN\\wo_?/???????@B@\e\\'

printf '\e( @\e[33m*(\e(B \e[36mThis is an important message \e( @\e[33m)+\e(B\e[m\n'

And works fine on bash:

However, when I do the same in TCC (using quotes around the argument instead of apostrophes, as one does), it doesn't display, despite me being in the same window with the same terminal display capabilities:


I think my printf needs to change under TCC, but I'm not sure where its' going wrong.

Any ideas?
This looks like a... stunningly byzantine way of displaying characters. You can display text with ECHO, and insert arbitrary characters with @CHAR:

echo %@char[0xd83c 0xdfba] This is an important message %@char[0xd83c 0xdfba]

I have not succeeded in making the Unicode emoji direction sequences work here. That may be because (A) I'm using Windows 10 and it does not support them, or (B) I haven't found any very good documentation on them and don't entirely grok them. Probably both of the above. But it should just involve adding a ZWJ (0x200D), a direction character (not well documented?), and a variant selector (0xFE0F) in the @CHAR function.

As for TCC's PRINTF? I don't use it. I don't even understand why it's there.
One issue (I'd bet there are more) ... In TCC, the escape character (0x1B) is ^e (not \e).

So, the problem turned out to be that TCC's internal printf did not behave the same as cygwin's.

I actually got these working. And the added benefit is that the newly defined trumpets accept ansi coloring, so I didn't just unlock flipped trumpets, but rainbow trumpets!

The solution is to set up a custom character set for the 2 trumpet emojis like this:

c:\cygwin\bin\printf.exe "\eP0;8;1;10;0;2;20;0{ @???~}{wo_?/[MFJp@@@@@/GCA@??????/??????????;?_ow{}~???/@@@@@pJFM[/??????@ACG/??????????;??????????/??_ogKYr}{/?_ow\\NVb`O/@B@???????;??????????/{}rYKgo_??/O`bVN\\wo_?/???????@B@\e\\"

(I'm using printf because that's what was used by the person who provided the solution. This absolutely could be decomposed to an echo statement, i just haven't bothered yet)

Once those are defined, the trumpets can be defined as environment variables (the first is original trumpet, the 2nd is custom character set trumpet, the 3rd is FLIPPED custom character set trumpet):


I can then define message decorators to create rainbow trumpets facing the message:


Note that anyone actually trying to implement this is going to need the TCC functions i use to set RGB colors via ansi [these are all the same function, i just make aliases so i don't have to remember word orders as much]:

function        ANSI_RGB=`%@CHAR[27][38;2;%1;%2;%3m`
              function     ANSI_FG=`%@CHAR[27][38;2;%1;%2;%3m`         
              function ANSI_RGB_FG=`%@CHAR[27][38;2;%1;%2;%3m`     
              function ANSI_FG_RGB=`%@CHAR[27][38;2;%1;%2;%3m`

There's a few other environment variables i use like "ANSI_GREEN" and such, if you REALLY want it ALL, i attached my set-colors.bat which defines my ansi environment variables, and my set-emoji.bat which defines my emoji environment variables


  • set-colors.bat
    21.2 KB · Views: 6
  • set-emojis.bat
    1.6 KB · Views: 5
  • emojienv.txt
    65.2 KB · Views: 8
You can always count on me to bring up weird esoteric console stuff.
P.S. I'm on windows 10.
As a completely unnecessary show-and-tell...

I have an emoji and a color associated with each machine in my network. They are defined as environment variables and used in scripts (example below).

Well now, I intend to change Wyvern's castle emoji's color to also be purple, instead of grey, and Demona's devil face emoji to be the skin color of the character Demona from Gargoyles that the machine is named after, instead of red.


But seriously, I want to beautify all my old bat files and make them use modern feature, and this has ben a really fun way to learn esoteric console, ANSI, emoji, and unicode stuff.

In that TCC thing I last posted, in the first command, there are a pair of backticks (``). They disappear when TCC executes the command. The command works just as well if they're simply removed!

The following should work too ... I used direct the ESC char ...


  • ColorTestDirect.btm
    65 bytes · Views: 8