You are not logged in.

#1 2013-07-11 01:06:01

splippity
Member
Registered: 2010-05-25
Posts: 144

unicode symbols not working in my terminal

Im trying to run a bash script that uses special symbols to give the desired affect.

someone suggested:

They are unicode symbols: yout $TERM needs to support them and you also have to have your locale set correctly

Im refering to : https://bbs.archlinux.org/viewtopic.php?id=84386

my locales looks like: en_US.UTF-8 UTF-8

I was trying to read up on unicode symbols and such but didnt get very far

I was looking in : https://wiki.archlinux.org/index.php/Locale
and https://wiki.archlinux.org/index.php/Fonts#Font_formats


thanks

Offline

#2 2013-07-11 01:09:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

Are you running this in your tty or some X terminal? Which one?
What's the output of 'localectl' 'cat /etc/vconsole.conf'?

Offline

#3 2013-07-11 01:09:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: unicode symbols not working in my terminal

So you know what information we need, but you didn't provide it?  What is your TERM set to?  Is this in a tty or in an terminal emulator in X, if the latter, which one?

I don't know what that means when you say that's what your locales look like, what command/file did that come from?  The actual output of `locale` or `localectl` would be useful (I prefer the former).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2013-07-12 22:56:36

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

sorry about the long time between posts
thanks.

Im using konsole in kde
I also tried xterm

 localectl
   System Locale: LANG=C
       VC Keymap: n/a
      X11 Layout: n/a


$ cat /etc/vconsole.conf
cat: /etc/vconsole.conf: No such file or directory

 locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Last edited by splippity (2013-07-12 22:57:39)

Offline

#5 2013-07-12 22:58:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

Switch to a utf8 locale :-)

Offline

#6 2013-07-12 22:59:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,139

Re: unicode symbols not working in my terminal

Trilby wrote:

What is your TERM set to?  Is this in a tty or in an terminal emulator in X, if the latter, which one?

I don't know what that means when you say that's what your locales look like, what command/file did that come from?

And why did you say

my locales looks like: en_US.UTF-8 UTF-8

?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2013-07-12 23:06:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

@cfr
That's what he uncommented in /etc/locale.gen.

Offline

#8 2013-07-12 23:08:43

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

yes thats what I uncommented and then I generated the locale so what did I do wrong?

Offline

#9 2013-07-12 23:16:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

splippity wrote:

yes thats what I uncommented and then I generated the locale so what did I do wrong?

https://wiki.archlinux.org/index.php/Lo … ide_locale

Offline

#10 2013-07-13 00:03:16

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

ok I followed those directions by setting it to: LANG="en_US.UTF-8"
will I now be able to have the symbols display properly in konsole?

Offline

#11 2013-07-13 00:06:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

splippity wrote:

ok I followed those directions by setting it to: LANG="en_US.UTF-8"
will I now be able to have the symbols display properly in konsole?

Why not test it?

Offline

#12 2013-07-13 00:47:52

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: unicode symbols not working in my terminal

splippity wrote:

ok I followed those directions by setting it to: LANG="en_US.UTF-8"
will I now be able to have the symbols display properly in konsole?

Sanity test... run "locale -a".  If you get output there that includes en_US.utf8, then you did it right.  If not, you're still missing a step.

Offline

#13 2013-07-17 06:54:26

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

> locale -a
C
en_US.utf8
POSIX


but the bash script still wont show the correct characters.
Was that just a part 1?

thanks

Offline

#14 2013-07-17 07:04:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

What's the output of 'locale' and 'localectl'?

Offline

#15 2013-07-17 19:27:27

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

locale
LANG=en_US.UTF-8
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=

localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a

Offline

#16 2013-07-17 19:42:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

It may be a font issue then.

Can you post the script you're trying to get to run properly?

Offline

#17 2013-07-17 22:00:07

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

Offline

#18 2013-07-17 22:14:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

I can see the unicode symbols properly both in X and in the tty:

┌───┤karol@black:5├─────────────┤├──
└─┤12:07 AM|$├─> locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=C
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=
┌───┤karol@black:5├─────────────┤├──
└─┤12:07 AM|$├─> localectl
   System Locale: LANG=en_US.UTF-8
                  LC_COLLATE=C
                  LC_MESSAGES=C
       VC Keymap: pl
      X11 Layout: n/a
┌───┤karol@black:5├─────────────┤├──
└─┤12:07 AM|$├─> cat /etc/vconsole.conf 
KEYMAP=pl
#FONT=lat2-16
FONT=Lat2-Terminus16
FONT_MAP=8859-2

I use Terminus font in X too.


What's the output of

echo $TERM

?

Offline

#19 2013-07-17 23:21:17

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

echo $TERM
xterm

Offline

#20 2013-07-17 23:29:18

splippity
Member
Registered: 2010-05-25
Posts: 144

Re: unicode symbols not working in my terminal

when I try cat /etc/vconsole.conf I get no such file exists

Offline

#21 2013-07-17 23:39:09

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: unicode symbols not working in my terminal

You shouldn't actually need vconsole.conf as long as you are sticking to the defaults.  It is only when you want to change something that that file becomes necessary.  But hey, maybe actually using it might help... I've got no other ideas.

Offline

#22 2013-07-17 23:41:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: unicode symbols not working in my terminal

xterm doesn't support unicode, does it?  Unless it's called as uxterm.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#23 2013-07-17 23:42:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: unicode symbols not working in my terminal

Trilby wrote:

xterm doesn't support unicode, does it?  Unless it's called as uxterm.

That's what I thought, but

┌───┤karol@black:6├─────────────┤├──
└─┤01:39 AM|$├─> echo $TERM
xterm

Edit: If I start it as uxterm, it still returns xterm as the $TERM (but htop shows it's 'xterm -class UXTerm -title uxterm -u8', not just 'xterm').

Last edited by karol (2013-07-17 23:44:23)

Offline

#24 2013-07-18 01:11:24

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: unicode symbols not working in my terminal

Xterm also supports utf-8 if your system locale is set properly, and the xterm resource 'locale' is set to true:

XTerm*locale: true

With my setup of xterm, the pcf version of Terminus renders differently depending whether you use xft or xlfd naming.  I usually use this text, http://www.cl.cam.ac.uk/~mgk25/ucs/exam … 8-demo.txt, to test font coverage.  Terminus, using either xft or xlfd, is missing some of the diagonal and X-shaped box characters.

With xft, or FreeType, many of the straight line box-drawing glyphs are missing.

$ xterm -fa "Terminus:size=12"

But most of the glyphs do show with xlfd:

$ xterm -fn "-*-terminus-medium-*-*-*-*-140-*-*-*-*-iso10646-*"

I would guess there's an incompatibility with Terminus and FreeType.  That might explain the faults found with Konsole.

Offline

#25 2014-10-03 13:15:54

tek
Member
Registered: 2009-04-19
Posts: 13

Re: unicode symbols not working in my terminal

Sorry to revive this thread, but this problem always anoying me. At last I found the solution, it was installing some fonts and restarting:
pacman -S ttf-freefont ttf-liberation ttf-droid

Offline

Board footer

Powered by FluxBB