Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have

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

$ locale -a
C
en_GB.utf8
POSIX
ru_RU.utf8

But man gives the error:

$ man
man: can't set the locale; make sure $LC_* and $LANG are correct
What manual page do you want?

If I set the LC_ALL, the error disappears:

$ LC_ALL=en_GB.UTF-8 man
What manual page do you want?

But I don't want to set LC_ALL because I set some LC_ to the other locale.

How to solve this problem with man?

share|improve this question
    
Try setting your locales to "ru_RU.utf8" not "ru_RU.UTF-8". –  sparticvs Nov 3 '12 at 14:37
    
LC_ALL=ru_RU.UTF-8 man cause no error. Thus, IMHO, man just considers not all LC_ are set. Maybe it need LC_ALL mandatory is set, but this is stupid behavior, I think... –  Corvus Nov 3 '12 at 14:49
    
Negative, LC_ALL is not required, see unix.stackexchange.com/questions/15291/… I looked at my locale settings and everything but LC_ALL is set for me. Mine are all set to "en_US.utf8" –  sparticvs Nov 3 '12 at 18:20

1 Answer 1

up vote 3 down vote accepted

I found this code in the source to man for Debian squeeze:

/* initialise the locale */
    if (!setlocale (LC_ALL, "") && !getenv ("MAN_NO_LOCALE_WARNING"))
        /* Obviously can't translate this. */
        error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
                 "are correct");
    setenv ("MAN_NO_LOCALE_WARNING", "1", 1);

Try setting the environment variable MAN_NO_LOCALE_WARNING to 1 to see if that helps. I'm not sure why setlocale (LC_ALL, "") is failing, according to the documentation for setlocale():

The return value is NULL if the request cannot be honored.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.