Advanced Ascii on Linux

How can I print these characters on Linux?

β”‚ (ascii 179)

β”œ (ascii 195)

β”” (ascii 192)

─ (ascii 196)

I cannot find octal values ​​that will work with echo -e "\ 0xxx", any ideas?

+6
source share
3 answers

After repeatedly looking at man printf and info printf , I think I got this to work.

The main problem is that bash has a built-in printf that does not work. And, despite the fact that man / info pages, say \U do not work. \U still does.

env printf '\u2502'

Gets the vertical bar symbol.

+5
source

You can use the same codes that you provided, or an extended ASCII character set (e.g. 195 for β”œ) if you have the correct encoder to display characters.

On Linux, we miss the custom extended ASCII character set support, so it does not appear. However, I found another character set available for Linux, and almost looks like an extended ASCII character set. This is an IBM855.

All you have to do is change the character encoding of your command line application to IBM855. All popular framed drawing characters have the same extended ASCII character code, which is the most important.

You can compare sets of image and image .

PS: If you use a gnome-terminal, you can add the IBM855 encoding by clicking on the "Terminal" menu in the menu bar β†’ "set character encoding" β†’ "Add or Remove". Find the IBM855 and add it. Now just select the encoding from "terminal" β†’ "set character encoding" β†’ "Cyrillic (IBM855)."

Their boxes were enough for my homework. Hope this helps. :)

+4
source

Either switch the font to PC-8 / CP437, or use the Unicode values ​​for these characters encoded in the current encoding instead.

+2
source

Source: https://habr.com/ru/post/885440/


All Articles