Is it bad that LANG and LC_ALL are empty when running `locale -a` on OS X Yosemite?

I am using OS X Yosemite.

When I run locale

I get this:

locale 
LANG= 
LC_COLLATE="C" 
LC_CTYPE="UTF-8" 
LC_MESSAGES="C" 
LC_MONETARY="C" 
LC_NUMERIC="C" 
LC_TIME="C" 
LC_ALL=

      

Question

Is emptiness LANG

and LC_ALL

bad / normal / preferred?

Usually I wouldn't care, but I have a warning

(process:16182): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.

      

when i used GTK

( here's a link to my previous quesiton on this ).

People struggle with this problem in many languages ​​( Python for example ) and different OS ( Ubuntu for example ).

Point I could not find a solution for C and OS X.

+2


source to share


1 answer


I would guess that the GTK warning is because GTK is actually trying to use the Mac language and language settings from the system preferences to create a locale id string using this c string setlocale()

, and was told that the C library doesn't work this locale. As a result, it defaults to "C". If it wasn't trying to find a better language, there would be little reason to warn that it is using the "C" locale, because that which would be expected when LANG

and is LC_ALL

not installed.

OS X supports many languages ​​and locales in the high-level framework (Cocoa, etc.), but not all of them are also supported at the C library level. What are the language and language settings in System Preferences? What language identifier do you expect from your language and language? See what it is on the way out locale -a

(or, similarly, if there is a directory for it in /usr/share/locale

).

Another thing to check is the terminal settings. In the Settings pane, the Advanced tab, set to Set Locale Environment Variables at Startup? If not, then these environment variables will not be set by default, which may explain what you are seeing. If the option is enabled, but you still don't get these environment variables, it means that Terminal could not find a suitable C library locale that matches your system settings.



Finally, you can just try to set LANG

to whatever you want to use. For example:

export LANG=pl_PL.UTF-8

      

+1


source







All Articles