command line – Unknown locale, assuming C – Error message in terminal

After running man, reading a manual entry and closing it, I receive the following error

$ man curl                     # The manual opens, I read it, then close
Unknown locale, assuming C
$ man zsh                      # The manual opens, I read it, then close
Unknown locale, assuming C

The manual pages work correctly, and can be browsed, but I have no idea where the error comes from, and it is rather annoying.

This is what I obtain when running locale

$ locale

More than fixing the error by editing locale, I would like to find the source of the error. Is it man or something else? Did anyone have the same problem?
I'm using Ventura 13.0.

Note that locale says

   LANG         Used as a substitute for any unset LC_* variable.     
If LANG is unset, it will act as if set to "C".  If any of LANG or    
LC_* are set to invalid values, locale acts as if they are all unset.

so there should be no error, LANG should be automatically set to C.


Some new insight. I ran the same commands on two computers.

Computer 1 runs 13.0 outputs the error.
This computer has man for MacOS 13.0 from January 9 2021.

Computer 2 runs 12.6 and outputs no error.
This computer has man version 1.6g from September 19 2005.

The output of the locale command is identical on both computers.

Could it be a man bug?

Author: Subham

Leave a Reply

Your email address will not be published. Required fields are marked *