I have a program that prints Unicode half-block characters (U+2580, U+2584), but on Debian 10 terminals (just the fullscreen terminal, no X), it's printing diamonds instead of half-blocks.
The two images below are the output of a Python program...
import sys
print(f"character encoding: {sys.stdout.encoding}")
print(chr(0x2580)) # upper half block
print(chr(0x2584)) # lower half block
print(chr(0x2588)) # full block
...followed by the output of locale
.
Also here are the contents of /etc/default/console-setup:
admin@flipdisc:~$ cat /etc/default/console-setup
# CONFIGURATION FILE FOR SETUPCON
Consult the console-setup(5) manual page.
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="Lat15"
FONTFACE="Fixed"
FONTSIZE="8x16"
VIDEOMODE=
I've noticed that:
- The macOS Terminal application prints the half-blocks correctly.
- When I SSH to the Debian machine in the macOS Terminal, it also prints the half-blocks correctly.
- The Debian terminal prints diamonds.
- I have a few other Debian machines and they also all print diamonds.
- The Debian terminal does print full blocks correctly, for some reason.
The locale
output identifies en_US.UTF-8
for both machines, and I'm not sure what else to check.
So my questions are:
- Why is the Debian terminal printing diamonds instead of the correct half-block characters?
- How do I make it print the correct characters?
/etc/default/console-setup
? (https://unix.stackexchange.com/questions/49779/can-i-change-the-font-of-the-text-mode-console) – Panki Sep 20 '23 at 16:45