DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So I'm running Debian sid, and Ion as my window manager.
When I launch a terminal in ion, no matter which it is (I've tried urxvt, and uxterm), the locales seem to be set right (en_US.utf8), but unicode characters show as garbage.
Then if I run another terminal from this existing one, it all works fine.
Of particular importance (from what I have learned) are two things:
1) what font you are using, and..
2) the LC_ environment variables.
Some of my terminals, I can start with my correct locale "en_US.UTF-8", but some require resetting $LC_ALL to "C" before starting the terminal, or unicode/multibyte chars are garbagy.
Tell us please, what are the unicode chars you are trying to display? What I mean is, are you trying to display another language, or are you trying to get something like what I was doing, with stuff like ncurses line-drawing chars?
Anyhow, start with a default, known-good font such as -misc-fixed, and play with your environment variables $LANG, LANGUAGES, and especially LC_ALL if the former ones don't help, before starting the terminal. You don't need to EXPORT them, just do like:
It is not entirely independent of the font; after all, if whatever font you are using, does not have the characters in its set that you are trying to print, it simply won't work.
However, for the sake of argument, let's say for the moment that your font is fine;
1) Did you have a look at the thread I linked? Try changing your LC_ALL or LANG or LANGUAGES variables to something else before launching your terminal?
and
2) You may need to specify on the commandline (when you launch your urxvt or uxterm) what Multi-Char Font the terminal should use for the characters you desire ( in addition to the 'regular' font you are using). Also make sure your terminal is compiled with the necessary multi-byte options required for displaying these sort of characters.
You have the first terminal, wherein the characters are messed up, right? Inside that terminal, run the `env` command to see all the variables in play.
Now, you say that if you launch another terminal FROM the first one, the characters display correctly, right? OK, from that second terminal, run `env` command again.
Compare the outputs of the two `env` commands you ran.
and see if one displays correctly and one does not.
Thanks for your patience! The problem definitely has to do with environment variables; it's a matter of demonstrating this, which I'm having trouble doing
Question: the commandshell from where you just launched those two urxvt instances, is it a LOGIN shell (interactive), or a non-interactive shell?
I ask because, if it is not a login shell, then the environment variables (and anything else) that are set up in the /etc/profile file and/or your shell's login config file .kshrc, will not be read.
To see if this is the case, do you have the option (I'm not familiar with Ion), or can you configure the launcher you are using for your terminal, to specify that the shell be a login shell? Usually this is done with an option such as -ls or -l or --loginShell when you launch the terminal.
Alternately, and easier than the above, just try sourcing your .kshrc file before trying to view the characters that are not displaying correctly, as this should do the same job, of setting the locale:
shell$ . ~/.kshrc # don't omit the period there at the start of the command; that 'period' is the 'source' command.
NOTE: I'm not 100% sure if this makes a difference, but I suggest that in your .kshrc and any other place where you define environment variables, you set the variables in two steps, like so:
LC_WHATEVER="blah"
export LC_WHATEVER
---
As a side question: How do you start your window manager? Are you using a login manager, like XDM, GDM, SLIM, or something like this, which is started by root? OR, are you booting to something like init 3, logging in as your user, and starting X with `startx`?
Hmm.. Currently I'm stumped as to what to suggest as being the "really correct fix" to this, but here's two suggestions, which you can either call them "a fix" or a "workaround" provided either one works:
1) in the /etc/X11/xinit/xinitrc file (or the comparable file on your system) put the two lines (even though they already seem to be set correctly anyway, which I don't understand) and ALSO make sure that this setting is in the /etc/profile file:
LC_ALL="en_US.UTF-8"
export LC_ALL
I would also put them in your ~/.xsession file too (yes, overkill and redundancy, but it won't hurt.. Put them everywhere!)
and (2) -- adjust the terminal launching code that your WM uses, to launch the terminal like we did above, like: LC_ALL="en_US.UTF-8" urxvt
instead of just launching it plain and simple.
I admit to not fully being able to tell precisely what's going wrong with your setup; I was starting to pull my hair out after my own several-day ordeal with this stuff too
Maybe someone else can pin down precisely where/why the disconnect is happening for you, but unfortunately I don't know what else to suggest
PS -- after doing all/any the above, I recommend logging out, going back to init 1 and back to init <graphical> again, so all the settings and config files are read fresh.
(Matter of fact, I am currently doing the EXACT same thing with the Nano editor at this very minute: I have a unicode character in my WM's text config file, and it refuses to display correctly in Nano; I can get three different forms of garbage from it, but not the proper character! I will definitely let you know if I get it sorted out.)
Sasha
Last edited by GrapefruiTgirl; 02-13-2010 at 01:41 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.