Unicode has "combining characters". How to use them?

with combining characters one can use 2 unicode characters at single location, creating a composition of two graphics. I'm thinking about simple ascii art, I would need to first use, as wikipedia says "SQUARE WITH HORIZONTAL FILL" ▤, and then on top of that, the letter "A". How to accomplish this?


Solution 1:

What is possible with the method you describe is a kind of abuse of diacritical marks. Fell free to play around a bit with it using following demo ( http://demo.danielmclaren.com/2015/diacriticism/ ).

Below some screenshots of the Unicode code I have got from the demo above:

Claudio.txt content copied to a terminal Claudio.txt content copied to a terminal

Claudio.txt displayed in gedit Claudio.txt displayed in gedit

Claudio.txt displayed in SciTE Claudio.txt displayed in SciTE

Sorry, but I don't know at the moment why exactly the representation of same underlying Unicode text is looking different in SciTE.

Here the HexCode of the Claudio.txt file:

Claudio.txt displayed as hex code in GHex Claudio.txt displayed as hex code in GHex

and here the Unicode copied/pasted to the stackoverflow answer editor box:

C̱̙̳̲͇͉̄̄̚l̝̩̩̝̺̠͞ā̝͉̩̟͆u̻͈̘̞̪̅̿d̝̄̅͆̚i͇̙͈̎̚o̘̟̎̄̄̎

As you have to be able to show ASCII art in a terminal I assume that there is no way to overlay two arbitrary Unicode characters for this purpose.

Solution 2:

Depending from the application or browser there are two ways to use the Unicode Combining Diacritical Marks:

  • With ā (a macron) as example, you may try to type in the 'a' first followed by the decimal code ̄

  • or ALT+ (it must be the + from the numeric keypad) followed by the hexadecimal code 0304 (i.e U+0304).

In some cases you can type in the combining diacritical mark first, followed by the 'a' or any other leading letter.