0

I am getting the following errors when I execute some commands on Solaris 10.

couldn't set locale correctly

Output of locale command-

LANG=en_US
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

Does LC_ALL need to be set? I don't have root on this machine.. can I specify locale in my rc files?

6
  • Which commands? Sep 16, 2009 at 15:09
  • Running a perl script
    – badkya
    Sep 16, 2009 at 16:18
  • So is this any Perl script or just one? If the latter, can you post the part of your script that is causing the error? LC_ALL is used for overriding the other settings. Sep 16, 2009 at 18:10
  • Do not set both LC_ALL and the other LC_ variables. Either unset LC_ALL, or set it to a valid value and unset the others.
    – mark4o
    Sep 17, 2009 at 13:57
  • I see... this shows up intermittently... I cannot seem to find a trend.. I'll hunt for the next instance of this error and try to find more about the command causing the error
    – badkya
    Sep 17, 2009 at 22:21

4 Answers 4

2

Locale settings are done via environment variables - you don't need to edit system files unless you want to change the defaults for every process on the system. The locale(5) and environ(5) man pages have more details on the various variables that affect locale settings.

locale -a will show the installed locales so you can make sure you've set it to one that's actually there.

2

You can use localeadm to install additional locales.

1

I suspect your Solaris installation is missing packages with locales. Try doing a full OS installation and then setting the locale.

0

locale -a gives you the list of installed locales. I believe that list doesn't contain en_US entry, so try setting LANG to "C" as well, or override it with setting LC_ALL to "C"

You must log in to answer this question.