0

The following line of code appears in a python source file. It appears exactly like this when the file is opened up in VS Code and in vi (as well as this text edit block). When I cat the file, the green square is replaced by several non-ascii characters. My question is how does one create a line of text with a swatch of some arbitrary color?

   'correct_place': '🟩',
2
  • don't know if this is a solution, but you might have to change the encoding of the cat command to match? unix.stackexchange.com/questions/78776/… Commented Dec 21, 2022 at 3:09
  • I don't care so much that cat isn't displaying the color swatch. What I want to know is how it got entered into the file, via vi or code, in the first place. Commented Dec 21, 2022 at 3:14

1 Answer 1

0

🟩 ("Large Green Square") is actually an emoji. Every emoji has a unicode number. The unicode number for 🟩 is U+1F7E9.

You can open a file in VSCode, copy the emoji above and paste it in that file (using the regular copy and paste commands on your computer, like command+C command+V).

You can also use the echo command in a Linux terminal to write this emoji into a file by using 🟩's unicode number, for example:
$ echo -e '\U0001F7E9' >> sizzzzlerz.txt
$ cat sizzzzlerz.txt
🟩

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.