1

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.

macOS / SSH (correct) Debian (diamonds)
enter image description here enter image description here

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?
Jason C
  • 1,383
  • 3
  • 14
  • 29
  • just curious, did you try to use a different font? – D'Arcy Nader Sep 20 '23 at 14:23
  • 1
    Could you add the contents of /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
  • @Panki I've added the contents of that file. – Jason C Sep 20 '23 at 17:43
  • @D'ArcyNader I did not, because I don't know how (I didn't even know you could do that). I'll research how to change fonts and if I can make something work I'll post back here. – Jason C Sep 20 '23 at 17:44
  • 1
    @JasonC See the question I linked, one of the answers mentions that. – Panki Sep 20 '23 at 19:39

0 Answers0