You are not logged in.

#1 2011-08-15 13:52:25

Registered: 2008-08-03
Posts: 5,931

[SOLVED] Xlib doesn't support custom locale

I've created an international English locale that uses a mix of ISO and POSIX standards with some tweaks for most formats. I've packaged it on my system so that I can add it to /etc/locale-gen, generate it with /usr/sbin/locale-gen, and set it via /etc/rc.conf.

I've run into a problem with Xlib when running the X server and various applications in it:

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

I can avoid this problem by setting LC_CTYPE to one of the standard locales (e.g. by exporting it in bash_profile), as described here, but this feels like a kludge.

The locale that I've created copies the LC_CTYPE from the same place that en_US does.* The LC_CTYPE is therefore identical and it should be "supported" by Xlib. I've even tried changing the name of the custom locale to variants of en_US@foo to see if XLib would recognize it.

There is nothing wrong with the formatting of the file.  All non-Xlib applications appear to work as expected without the LC_CTYPE environment variable. It is correctly recognized by `locale -a`:


(XX is a country code reserved for private use, so it's an ISO-compliant name)

I'm running out of ideas. Creating a locale is starting to feel like some super secret initiation ritual.  There must be some way to make Xlib recognize that it is a fully standard LC_CTYPE locale. Any suggestions or relevant information would be appreciated.

Btw, I'll probably release this as a package if I'm able to get around this (hopefully) final issue.  I'm quite happy with the locale so far.

I've found this: … to-ubuntu/

I haven't actually tested it yet but it seems that if libx11 is already installed I could modify those files to support the custom locale. That doesn't really solve the problem though because any modifications would be removed when libx11 is (re-)installed or upgraded.


* In /usr/share/i18n/locales, en_US includes the following section:

copy "en_GB"

en_GB in turn copies its LC_CTYPE section from "i18n". In my custom locale, I've tried copying "i18n" and "en_US". Both work but neither is recognized by Xlib.

Last edited by Xyne (2011-08-15 16:30:42)


#2 2013-09-03 11:39:49

Registered: 2008-08-03
Posts: 5,931

Re: [SOLVED] Xlib doesn't support custom locale

Related discussion may be found here and here.

Marking as solved and closing.


Board footer

Powered by FluxBB