LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-06-2007, 12:43 AM   #1
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Rep: Reputation: 32
locales conflict with man and x


Hello everyone,

I have read all the old posts about this... but I haven't found a good way to fix my particular problem (except a workaround or two).

I have run dpkg-reconfigure locales and have set my locale to en_US.UTF-8

My problem:
In the bash shell man pages don't have the ' (single quote). Instead they display as square blocks. In X in a terminal window the man pages display perfectly.

If I set my locale to en_US.iso-8859-1 man pages display correctly, but X has some minor issues (UXTerm doesn't load properly - it works, but I think it instead defaults to just XTerm instead - not sure). X also displays errors after I exit.

Same goes if I set my locale to en_US.iso-8859-15.

I'm a little confused by this locale deal. I understand that the locale basically tells your computer where you are using it and what languages and charsets to use... I don't understand why there are three options (UTF-8, iso-8859-1 and iso-8859-15).

What locale should I pick?

How can I get both man and X to speak the same language without characters missing or programs not running oddly?

Do I need to dpkg-reconfigure X to match my new locale settings?


Thank you in advance ladies and gents!

P.S. The one workaround I found was to create an alias for man:
Code:
env LC_ALL="en_US" man <whatever>
or
Code:
env LC_ALL="C" man <whatever>
I instead would like to get it completely figured out. I don't like workarounds... but I suppose I can live with them if I have to.
 
Old 11-07-2007, 01:51 AM   #2
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
Talking Fixed locale problem in Debian Etch (X and man issues)

Hey guys,

I discovered the error of my ways... well, I guess it wasn't technically my error.

I attempted to fix my problem by doing
Quote:
dpkg-reconfigure locales
I selected the appropriate language and charset and then let it do its job. Below is my /etc/locale.gen file:
Code:
# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED. Other
# combinations are possible, but may not be well tested. If you change
# this file, you need to rerun locale-gen.
#
en_US.UTF-8 UTF-8

I was still having issues with X and man. I could get one to work fine but the other would act strangely. Both would function... but one would always have odd side-effects.

I discovered that the SUPPORTED file listed 3 en_US options:
en_US.UTF-8 UTF-8
en_US iso-8859-1
en_US.iso-8859-15 iso-8859-15

**Notice that two of them have a '.' in them followed by a charset, a ' ' (space) and a charset. Onle one has one LANG and one charset separated by spaces.

Well, I got curious. I couldn't figure out why some had '.' in them with two charsets and others had ' ' and one charset.

On a hunch I edited my /etc/locale.gen file:
Code:
# This file lists locales that you wish to have built. You can find a list
# of valid supported locales at /usr/share/i18n/SUPPORTED. Other
# combinations are possible, but may not be well tested. If you change
# this file, you need to rerun locale-gen.
#
en_US UTF-8
I took out the '.' and the extra charset.

Did a
Code:
locale-gen
Then tested man - No more complaint of:
Quote:
man: can't set the locale; make sure $LC_* and $LANG are correct
or UXTerm issues or complaints from X

I'm ecstatic!
 
Old 11-07-2007, 02:20 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And it's kind of you to come back and share the experience.

I'm sure it will help others!


Cheers,
Tink
 
Old 11-07-2007, 02:32 AM   #4
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
Thumbs down Well... almost...

I take that back. I'm back where I started from.

I'm still not sure what is going on.

man still displays white squares for characters such as ' (single quote) and - (text that carries on to next line).

UXTerm works fine - right colors and font/size

I did find that if I did a
Code:
localedef --list-archive
I got back:
Quote:
en_US
en_US.utf8
If I do a
Code:
localedef --delete-from-archive en_US.utf8
UXTerm doesn't have correct colors or font/sizes
Also after shutting down X I get numerous errors about the locale not being right...

I will not rest until I find out what the h3LL is going on.

Last edited by checkmate3001; 11-07-2007 at 02:52 AM. Reason: fixed a code block
 
Old 11-07-2007, 02:50 AM   #5
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
I think I am COMPLETELY incorrect about changing locale.gen.
I don't think that en_US UTF-8 is correct...
I think it may (perhaps) really be en_US.UTF-8

...

confusing...
...
....

I will definitely post when I get this all sorted out.
 
Old 11-07-2007, 03:04 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
This link may help:
http://www.onlamp.com/pub/a/onlamp/2...roduction.html
 
Old 11-07-2007, 03:46 AM   #7
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
Cool I made it submit - locales make me loco

Well...

I found another work-around.

Because it bothered me so much to have man not displaying certain characters I decided to change my locale to en_US.iso-8859-15 (to be honest I have no idea how different this is from iso-8859-1, but it is VERY different than UFT-8 from what I've read).

So I got man working perfectly. Just how I want it.

Next on to X

It seems that for whatever reason (in some way related to UXTerm using UTF-8 and since I'm no longer using UTF-8...) UXTerm doesn't load properly so XTerm takes over. For whatever reason XTerm doesn't display the same colors or fonts that UXTerm once did. To remedy this I found the font I wanted to use (man this is a pain of trial and error even when using gtkfontsel and xfontsel).

I recommend running this command in X to try out the different fonts:
Code:
xterm -font <font selection>

I edited my $HOME/.xinitrc file (create it if it doesn't exist) and included this line:
Code:
xrdb -merge $HOME/.Xresources
I edited my .Xresources file (create it if it doesn't exist) and included the font:
Code:
xterm*font: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
I then had two options as far as getting the colors back the way they were (that I could think of).

A)
Copy them from the /etc/X11/app-defaults/UXTerm file or XTerm-color file and put them in my .Xresources file.

or

B)
Edit my .xinitrc file once more and add this line:
Code:
xrdb -merge /etc/X11/app-defaults/XTerm-color
I opted for option B, but I think I may go to A. The reason is because I don't like some of the colors that the menu (control-left click) has... I'm fond of black and grey colors. The default is a orangish-brown color... kinda like wood or something.

Well... this has been my adventure. Man I'm pooped.

I got it just the way I want it tho - that's why I love Linux
 
Old 11-07-2007, 03:50 AM   #8
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
jschiwal - Thank you for that link... I'm going to look at it tomorrow. I'm worn out...




Thank you guys for the tips!
 
Old 11-18-2007, 11:48 PM   #9
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
I'm still not happy with the fact that I have to use ISO-8859-15 when I want to use UTF-8. I know it doesn't even matter because I only use the English alphabet anyways... but I'm stubborn.

I was wondering if anyone could answer these questions for me:
1) When using UTF-8 why won't man pages display correctly in the log-in shell (not through an X session) but will display correctly in an X-shell?
2) Why do I get the same results (man pages displaying correctly) if I use
Code:
LC_ALL=en_US.ISO-8859-15 man <somepage>
or if I use
Code:
LC_ALL=poop man <somepage>
I will get errors for both... but the man pages display correctly. This is driving me nuts. I can't understand why only the " ' " (apostrophe) won't display correctly. It is the stupidest thing in the world but it is bugging me to no end.
 
Old 11-19-2007, 12:50 AM   #10
checkmate3001
Member
 
Registered: Sep 2007
Location: Folsom, California
Distribution: Ubuntu, Mint, Debian, Suse
Posts: 307

Original Poster
Rep: Reputation: 32
I have noticed one more thing that I find strange.

Any text displayed in man pages that is in bold WILL display hyphens "-" and apostrophes "'" correctly. Normal (un-bold) text will not.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
waht file have paths for man? man.conf? where? xcore_on Linux - Newbie 4 05-23-2006 09:38 AM
Man pages error, Dual Locales caused it? Debian Sid. bence8810 Debian 3 03-19-2006 01:02 PM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 08:52 AM
How to quit man (less) and keep man info on screen? peb Linux - Newbie 7 03-25-2004 10:02 PM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration