You are not logged in.

#1 2016-12-30 21:13:54

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

[SOLVED] URxvt doesn't show unicode characters

This is one of the longer-running issues I can't seem to wrap my head around (and fix). URxvt is my terminal emulator (using i3 in case that matters).

Running locale dumps this:

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

I'm not sure what else I need to do to make URxvt show unicode characters. Any thoughts?

I've been doing a few workarounds, like to my Vim NERDTree dir arrows: https://github.com/tstringer/dotfiles/b … rc#L57-L58

But I'd rather fix this now if possible.

Thank you in advance!

Last edited by thomas_stringer (2017-01-04 20:59:22)

Offline

#2 2016-12-31 00:49:00

monodromy
Member
Registered: 2014-02-08
Posts: 62

Re: [SOLVED] URxvt doesn't show unicode characters

That's odd. I just tried your font (Fira Mono) in my own Xresources, and unicode displays properly. Are you sure you have rxvt-unicode and not rxvt?

Offline

#3 2016-12-31 01:40:14

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

monodromy wrote:

That's odd. I just tried your font (Fira Mono) in my own Xresources, and unicode displays properly. Are you sure you have rxvt-unicode and not rxvt?

printenv TERM returns "rxvt-unicode-256color".

Funny thing was, colors weren't showing up well, and I had to remove this line from my .Xresources file: https://github.com/tstringer/dotfiles/b … sources#L5

Once I removed that, terminal colors worked. Hoping that it would fix my unicode issue as well, but unfortunately I still get the "boxes" with unicode characters.

Offline

#4 2016-12-31 01:47:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] URxvt doesn't show unicode characters

Forcing the term is a bad idea; it just breaks things.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2016-12-31 01:51:06

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

jasonwryan wrote:

Forcing the term is a bad idea; it just breaks things.

I removed that, but still no working Unicode characters. What else could cause this?

Offline

#6 2016-12-31 02:01:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] URxvt doesn't show unicode characters

Crappy font? Try with Dejavu. Generally, though, it is a locale issue.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2016-12-31 02:05:25

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

jasonwryan wrote:

Crappy font? Try with Dejavu. Generally, though, it is a locale issue.

Just tried it with (and now using) inconsolata. Still no good. That seems like a popular font too, I would imagine it has Unicode support.

Stupid question, how could I test Unicode OUTSIDE of Vim? I should probably remove Vim (and my vimrc) out of the equation.

Offline

#8 2016-12-31 02:25:34

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

Re: [SOLVED] URxvt doesn't show unicode characters

thomas_stringer wrote:

how could I test Unicode OUTSIDE of Vim?

echo -e "\uXXXX"

where XXXX is a hex code of a character, eg:

$ echo -e "\u0641"
ف

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2016-12-31 03:33:11

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

Trilby wrote:
thomas_stringer wrote:

how could I test Unicode OUTSIDE of Vim?

echo -e "\uXXXX"

where XXXX is a hex code of a character, eg:

$ echo -e "\u0641"
ف

Thanks for that! Unfortunately the same result outside of Vim. I get a box returned when I run `echo -e "\u0641"`.

With my output of `locale` (see below), it couldn't perhaps be the double quotes for the vars throwing it off, could it?

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

I'm reaching at straws here, I'm unsure of what else to look at.

Do you see anything blatantly wrong with my .Xresources? https://github.com/tstringer/dotfiles/b … Xresources

The funny thing is, within Chromium the unicode character in my i3 config shows up no problem: https://github.com/tstringer/dotfiles/b … onfig#L100

But if I view the contents of that file in URxvt then I get the dreaded unicode box. So it must be something to do with my terminal [configuration]? Outside of .Xresources, is there any other place I should look for misconfiguration?

Offline

#10 2016-12-31 03:37:57

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] URxvt doesn't show unicode characters

I told you not to force TERM as it breaks things...
https://github.com/tstringer/dotfiles/b … rofile#L13


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2016-12-31 03:39:55

loqs
Member
Registered: 2014-03-06
Posts: 18,420

Re: [SOLVED] URxvt doesn't show unicode characters

What is the output of

$ locale -a

Offline

#12 2016-12-31 03:50:48

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

jasonwryan wrote:

I told you not to force TERM as it breaks things...
https://github.com/tstringer/dotfiles/b … rofile#L13

That's actually an old .bash_profile from my other machine, the current .bash_profile on this machine has the contents:

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

Offline

#13 2016-12-31 03:52:02

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

loqs wrote:

What is the output of

$ locale -a

Interestingly enough, here is the output:

C
en_US
en_US.iso88591
en_US.utf8
POSIX

What is the "C"? I had noticed that my original locale had all said "C" prior to generating them. Is this "bad" output for `locale -a`?

Offline

#14 2016-12-31 16:10:11

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

Just playing around, I ran urxvt from urxvt to see what would happen when I try to print out a unicode char. Here is the parent process/terminal output:

trstringer@archdesktop ~
$ urxvt
# comment inserted for explanation: in the child urxvt process I ran `echo -e "\u0642"`
urxvt: unable to calculate font width for ':slant=0:weight=100:pixelsize=24:minspace=True:lang=ar', ignoring.
urxvt: unable to calculate font width for 'Courier New:slant=0:weight=100:pixelsize=24:antialias=False:autohint=True:minspace=True', ignoring.

Is that possibly a/the error that is causing my unicode chars to not show up? (show up as a box)

Offline

#15 2016-12-31 16:18:47

loqs
Member
Registered: 2014-03-06
Posts: 18,420

Re: [SOLVED] URxvt doesn't show unicode characters

What is the output of

$ fc-match 'Courier New:slant=0:weight=100:pixelsize=24:antialias=False:autohint=True:minspace=True'

Offline

#16 2016-12-31 16:36:02

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

loqs wrote:

What is the output of

$ fc-match 'Courier New:slant=0:weight=100:pixelsize=24:antialias=False:autohint=True:minspace=True'

Cousine-Regular.ttf: "Cousine" "Regular"

Offline

#17 2016-12-31 16:39:43

thomas_stringer
Member
From: In the Ocean somewhere...
Registered: 2016-12-13
Posts: 46
Website

Re: [SOLVED] URxvt doesn't show unicode characters

So if I comment out this line in my .Xresources: https://github.com/tstringer/dotfiles/b … sources#L4 (URxvt.letterSpace:-2) then I can print out the unicode character on the command line!

Is that now how you are supposed to "compact" the letter spacing in URxvt? The letters are really wide apart by default.

That was only half of the battle. Even so, in Vim I still can't get the dir arrows in NERDTree or the "chrome" font awesome glyph showing in my i3 config. It seems like the latter might just be a known/ongoing issue with Font Awesome in urxvt though. So I can live with that.

And maybe the dir arrows in NERDTree (Vim) are just not part of the character set that I'm currently using? Either way, definitely progress.

EDIT: Looks like I can reduce the letterSpacing by -1 and still have those unicode chars show up, but any more than that and urxvt can't display them. letterSpace:-1 it is!

Last edited by thomas_stringer (2016-12-31 16:42:33)

Offline

#18 2017-01-04 20:53:49

Steinberg2010
Member
Registered: 2016-01-28
Posts: 73

Re: [SOLVED] URxvt doesn't show unicode characters

Not sure if your issue is related to mine (you piqued my interest when I read this thread).

I used source code pro for powerline in vim.

URxvt.letterSpace: -1

Prevents the unicode character that trilby suggested above from appearing (I get a little box).

Commenting out the letterspace line makes it possible to view the Arabic character, however, it makes the text a little loose for my taste.

~S

Offline

Board footer

Powered by FluxBB