Right now, it looks like this:
-
it's a real 80x25 textmode terminal, so you can't use more than 256 characters. Use framebuffer console if you want real utf-8.Ipor Sircer– Ipor Sircer2016-08-16 12:57:08 +00:00Commented Aug 16, 2016 at 12:57
-
Possibly related: stackoverflow.com/questions/12649896/…Matthias Braun– Matthias Braun2023-09-13 20:27:18 +00:00Commented Sep 13, 2023 at 20:27
3 Answers
Check that you have the locales package installed
dpkg -l locales
If not, install it
apt-get install locales
As root, type
dpkg-reconfigure locales
you can navigate that list with the up/down arrow keys, for example choose en_US-UTF-8
edit your .bashrc by adding the following lines:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
Run the localecommand ,the output should be similar to this::
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
-
3I do have the package installed - I think it comes by default with Debian Wheezy. It's just that the console wasn't in UTF-8 mode.Mihai– Mihai2016-08-17 10:29:23 +00:00Commented Aug 17, 2016 at 10:29
-
Be aware that this answer is for Debian-like distros only (Debian, Ubuntu, Mint, etc.), so it won't work for e.g. Fedora. Also not exactly what the OP requested, but useful anyway.rsenna– rsenna2024-11-22 12:38:40 +00:00Commented Nov 22, 2024 at 12:38
-
@rsenna The question is tagged DebianGAD3R– GAD3R2024-11-22 13:42:47 +00:00Commented Nov 22, 2024 at 13:42
-
1True @GAD3R. When I said "be aware", I really was not talking to you... I meant as I reminder to anyone else who ended up here. Not meant as criticism to you at all!rsenna– rsenna2024-11-22 22:42:16 +00:00Commented Nov 22, 2024 at 22:42
Sure (it's limited on the number of glyphs, but it seems your locale is using UTF-8 encoding).
I use this for testing:
#!/bin/sh
# send character-string to enable UTF-8 mode
if test ".$1" = ".off" ; then
printf '\033%%@'
else
printf '\033%%G'
fi
and (calling it "utf8"), "utf8 on" turns the encoding on.
Using the example given with pstree, here is an example after running the script (before, the same sort of output as in the question):
As noted in a comment, there's a script unicode_start which does more, but all that is needed to address the question posed is the small script used as an example.
Addressing a different comment: At least on my system (and in the screenshot shown in the question), all of the characters used by pstree are supplied in the 512-glyph font used by default for Unicode support in the Linux console.
Further reading:
-
3The questioner appears to be running Debian 7. That has
unicode_startin itskbdpackage, which does slightly more than your script.JdeBP– JdeBP2016-08-16 13:33:55 +00:00Commented Aug 16, 2016 at 13:33 -
This is amazing. I messed with this for days to no avail. Running ` printf '\033%%G'` turned it ondman– dman2023-06-11 23:20:32 +00:00Commented Jun 11, 2023 at 23:20
Set CHARMAP="UTF-8" in /etc/default/console-setup.
Run systemctl daemon-reload && systemctl restart console-setup.service afterwards.
-
Changing that setting worked for me, but I needed to restart the computer; the
systemctlcommands weren't enough for me. +1alx - recommends codidact– alx - recommends codidact2023-11-10 11:41:22 +00:00Commented Nov 10, 2023 at 11:41

