You are not logged in.

#1 2013-05-14 13:44:31

Velmorkon
Member
Registered: 2013-05-14
Posts: 6

Locale issue

I'm having a problem with certain unicode symbols not displaying properly in terminals (urxvt OR xterm). They'll display fine in any X-based editor (http://i.imgur.com/kRcvmYE.png) but just show up as blocks in terminals (http://i.imgur.com/vvRPFbC.png). My searches so far seem to imply it's an issue with locale settings, but everything seems fine on that front:

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

locale -a:

C
en_US
en_US.iso88591
en_US.utf8
POSIX

Uncommented lines in locale.gen:

en_US.UTF-8 UTF-8
en_US ISO-8859-1

locale.conf:

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8

$TERM:

rxvt-unicode-256color

Upon running urxvt:

urxvt: the locale is not supported by Xlib, continuing without locale support.

And xterm:

Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default

Other possibly relevant info: Awesome WM

Any suggestions?

Offline

#2 2013-05-14 14:16:55

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

Re: Locale issue

https://github.com/exg/rxvt-unicode/blo … src/init.C says it may have something to do with XIM.

Last edited by karol (2013-05-14 14:20:28)

Offline

#3 2013-05-14 15:05:28

Velmorkon
Member
Registered: 2013-05-14
Posts: 6

Re: Locale issue

I don't believe that it's an issue with urxvt alone - the problem occurs in xterm as well.

Offline

#4 2013-05-14 15:08:54

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

Re: Locale issue

I know, but this is the only trace so far: are you using any input method?

Edi 1: I have

$ echo $TERM
rxvt-256color

but I don't know if this changes anything.

Edit 2: Google shows quite a few hits for the error that xterm shows, unfortunately I haven't found any explanation yet e.g. https://bbs.archlinux.org/viewtopic.php?id=67850 is different from your case.

Last edited by karol (2013-05-14 15:16:03)

Offline

#5 2013-05-14 19:19:31

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Locale issue

Your terminal emulator might just use the wrong fonts.

Offline

#6 2013-05-14 19:26:51

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

Re: Locale issue

cookies wrote:

Your terminal emulator might just use the wrong fonts.

Why would it print the locale warning then?

Offline

#7 2013-05-14 19:35:44

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Locale issue

karol wrote:
cookies wrote:

Your terminal emulator might just use the wrong fonts.

Why would it print the locale warning then?

Good point, I missed that. Sorry.

Offline

#8 2013-05-14 23:15:03

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

Re: Locale issue

How are you setting the TERM variable?  You can get strange behavior if TERM is set incorrectly, which seems to be the case here.  If you have set TERM in ~/.bashrc or ~/.bash_profile, you should remove it.  When TERM is not set correctly, the terminal may use the wrong TERMINFO database – meaning strange things happen in the terminal display.

With a stand-alone urxvt, 'echo $TERM' returns 'rxvt-unicode-256color' here.  I have done nothing to set TERM for urxvt.

Xterm has two term settings that seem to work well for most people, 'xterm' and 'xterm-256color'.  Since your locale seems to be set correctly, try this in your X resources:

XTerm*locale: true
! Vim colorschemes lag for me with TERM set
!   to the default 'xterm'.
!   The following line is optional.
xterm*termName: xterm-256color

Offline

#9 2013-05-15 02:42:34

Velmorkon
Member
Registered: 2013-05-14
Posts: 6

Re: Locale issue

thisoldman wrote:

How are you setting the TERM variable?

I'm not setting TERM anywhere; it's defaulting to 'rxvt-unicode-256color' or 'xterm-256color' which seems to be the correct value. The .Xresources changes don't seem to have made any sort of impact either - at least not one that's visible to me.

Out of curiosity, what output are any of you getting from 'localectl status'?

Offline

#10 2013-05-15 06:29:17

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Locale issue

Velmorkon wrote:

Out of curiosity, what output are any of you getting from 'localectl status'?

   System Locale: LANG=en_GB.utf8
       VC Keymap: de-latin1-nodeadkeys
      X11 Layout: n/a

Offline

#11 2013-05-15 10:55:23

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

Re: Locale issue

I think this has to be a font problem, now.  What are your font settings?  But the locale warnings make me still wonder.

Last edited by thisoldman (2013-05-15 10:57:31)

Offline

#12 2013-05-16 04:47:09

Velmorkon
Member
Registered: 2013-05-14
Posts: 6

Re: Locale issue

localectl status matches cookies' in syntax, so I don't think it's a config issue there.

I don't think it's a font issue as I'm getting the same results with the couple other fonts I tried out. It has something to do with how the characters are displayed in the terminals; they still show fine in any X-based text editor.

Offline

#13 2013-05-16 10:57:48

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Locale issue

Have you tried other unicode characters? Do those get displayed correctly or does your terminal emulator turn them into blocks, too?

If other unicode characters get displayed correctly then your current font does not have a graphical representation for your chosen characters and replaces them with a placeholder. http://en.wikipedia.org/wiki/List_of_Unicode_characters has some nice examples.

Offline

#14 2013-05-16 12:39:01

Velmorkon
Member
Registered: 2013-05-14
Posts: 6

Re: Locale issue

cookies wrote:

Have you tried other unicode characters? Do those get displayed correctly or does your terminal emulator turn them into blocks, too?

Other unicode characters display properly in graphical editors but not terminals, even when using the same font in both. The confusing part is I have an old Arch VM on the same computer and it doesn't have this problem, even with identical locale settings and font.

Last edited by Velmorkon (2013-05-16 12:45:11)

Offline

#15 2013-05-16 16:23:53

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

Re: Locale issue

GUI editors use fontconfig rules to substiue glyphs when the chosen font does not have the glyph available.  Urxvt and xterm only have the glyphs available in the fonts you specify.  If the font chosen for either of those two terminal emulators does not have the character included, at best you will get an empty rectangle.

There are other terminal emulators that do use fontconfig.

Offline

Board footer

Powered by FluxBB