You are not logged in.

#1 2010-08-18 05:31:49

havresylt
Member
Registered: 2010-01-11
Posts: 13

[SOLVED] Problems with Xlib and nonstandard locales

When using for instance the locale en_DK, which I have made sure is available, I'm having some trouble with Xlib. urxvt for instance prints the following warning at startup:

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

What's worse, it also prevents xmobar from loading properly. It simply crashes instantly with the following error message:

xmobar: user error (createFontSet)

The problem is also there when using my custom locale en_MY, but not with e.g. en_US, sv_SE and de_DE. So it seems like some locales doesn't work with/aren't enabled for Xlib. It also seems like the problem is the _name_ of the locale since if I copy one of the failing locales to for instance en_US, that one works too. Is there something that has to be done, other than putting the locale in /etc/locale.gen, and running locale-gen?

Last edited by havresylt (2010-09-13 08:39:38)

Offline

#2 2010-08-18 09:53:39

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

Re: [SOLVED] Problems with Xlib and nonstandard locales

I've set my locales and urxvt works:

$ locale
LANG=en_DK.UTF-8
LC_CTYPE="en_DK.UTF-8"
LC_NUMERIC="en_DK.UTF-8"
LC_TIME="en_DK.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_DK.UTF-8"
LC_MESSAGES=C
LC_PAPER="en_DK.UTF-8"
LC_NAME="en_DK.UTF-8"
LC_ADDRESS="en_DK.UTF-8"
LC_TELEPHONE="en_DK.UTF-8"
LC_MEASUREMENT="en_DK.UTF-8"
LC_IDENTIFICATION="en_DK.UTF-8"
LC_ALL=

But of course if you set it to "en_DK"

[karol@black ~]$ export LC_ALL="en_DK"
[karol@black ~]$ locale
LANG=en_DK.UTF-8
LC_CTYPE="en_DK"
LC_NUMERIC="en_DK"
LC_TIME="en_DK"
LC_COLLATE="en_DK"
LC_MONETARY="en_DK"
LC_MESSAGES="en_DK"
LC_PAPER="en_DK"
LC_NAME="en_DK"
LC_ADDRESS="en_DK"
LC_TELEPHONE="en_DK"
LC_MEASUREMENT="en_DK"
LC_IDENTIFICATION="en_DK"
LC_ALL=en_DK
[karol@black ~]$ urxvt
urxvt: the locale is not supported by Xlib, working without locale support.

it wont :-)

Offline

#3 2010-08-18 17:35:29

havresylt
Member
Registered: 2010-01-11
Posts: 13

Re: [SOLVED] Problems with Xlib and nonstandard locales

Then something is very wrong with my system. I tried doing

export LC_ALL="en_DK.UTF-8"

and then launching urxvt, but I still get the error message. What could be wrong? Is there a way to restore packages to their default?

Offline

#4 2010-08-18 17:42:46

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

Re: [SOLVED] Problems with Xlib and nonstandard locales

havresylt wrote:

Then something is very wrong with my system. I tried doing

export LC_ALL="en_DK.UTF-8"

and then launching urxvt, but I still get the error message. What could be wrong? Is there a way to restore packages to their default?

What packages? You can set your locales to whatever you want.
Uncomment the desired locale in /etc/locale.gen, generate the locale, set it in /etc/rc.conf, reboot and it should work. Check if you have the correct locales (I export LC_MESSAGES=C in .bashrc, so you can have similar scripts that change your locale).

Offline

#5 2010-08-19 06:46:32

havresylt
Member
Registered: 2010-01-11
Posts: 13

Re: [SOLVED] Problems with Xlib and nonstandard locales

What I meant was that there obviously seems to be something wrong some other part of the configuration. For some reason Xlib doesn't like some locales. I thought if I reset some of the packages it might have an effect. But I really have no clue at all. Someone has an idea what might be broken?

Offline

#6 2010-08-19 06:57:48

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

Re: [SOLVED] Problems with Xlib and nonstandard locales

havresylt wrote:

What I meant was that there obviously seems to be something wrong some other part of the configuration. For some reason Xlib doesn't like some locales. I thought if I reset some of the packages it might have an effect. But I really have no clue at all. Someone has an idea what might be broken?

So you did everything I posted, your locales looks like mine (the first listing) and you still get an error?

Offline

#7 2010-08-19 18:51:11

havresylt
Member
Registered: 2010-01-11
Posts: 13

Re: [SOLVED] Problems with Xlib and nonstandard locales

karol wrote:
havresylt wrote:

What I meant was that there obviously seems to be something wrong some other part of the configuration. For some reason Xlib doesn't like some locales. I thought if I reset some of the packages it might have an effect. But I really have no clue at all. Someone has an idea what might be broken?

So you did everything I posted, your locales looks like mine (the first listing) and you still get an error?

Yes, exactly: http://pastebin.com/5eM77rBN

Offline

#8 2010-08-19 19:36:00

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

Re: [SOLVED] Problems with Xlib and nonstandard locales

What's the output of

grep -v ^# /etc/locale.gen

?
It should list en_DK.UTF-8 UTF-8.

Offline

#9 2010-08-19 20:22:34

havresylt
Member
Registered: 2010-01-11
Posts: 13

Re: [SOLVED] Problems with Xlib and nonstandard locales

Yes I have enabled it:

$ grep -v ^# /etc/locale.gen
en_MY.UTF-8 UTF-8
en_MY ISO-8859-1
en_DK.UTF-8 UTF-8  
en_DK ISO-8859-1  
en_US.UTF-8 UTF-8  
en_US ISO-8859-1  
sv_SE.UTF-8 UTF-8  
sv_SE ISO-8859-1

Last edited by havresylt (2010-08-19 20:23:04)

Offline

#10 2010-08-19 22:28:00

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

Re: [SOLVED] Problems with Xlib and nonstandard locales

havresylt wrote:

Yes I have enabled it:

$ grep -v ^# /etc/locale.gen
en_MY.UTF-8 UTF-8
en_MY ISO-8859-1
en_DK.UTF-8 UTF-8  
en_DK ISO-8859-1  
en_US.UTF-8 UTF-8  
en_US ISO-8859-1  
sv_SE.UTF-8 UTF-8  
sv_SE ISO-8859-1

I've jsut remembered the right way to do ^

locale -a

;P

Try https://bbs.archlinux.org/viewtopic.php?pid=645074 ; basically

export LC_CTYPE="en_US.utf8"

should help.

Offline

#11 2010-08-20 05:21:27

havresylt
Member
Registered: 2010-01-11
Posts: 13

Re: [SOLVED] Problems with Xlib and nonstandard locales

Wow I can't believe I missed that thread. Thank you for finding it!

Then it is as I thought, that it's the name of the locale that is causing confusion. I also had to be careful not to set LC_ALL, since that seems to override any custom settings for the other variables. It's pretty confusing how these variables work.

Still, if you really are using the locale in your first listing, it's weird that it works for you and not for me.

Offline

Board footer

Powered by FluxBB