它是坏的LANG和LC_ALL运行`语言环境-a`在Mac OSX优山美地的时候是空的? [英] Is it bad that LANG and LC_ALL are empty when running `locale -a` on Mac OSX Yosemite?

查看:368
本文介绍了它是坏的LANG和LC_ALL运行`语言环境-a`在Mac OSX优山美地的时候是空的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Mac OSX的优胜美地。

I use Mac OSX 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=

问题1:

请问的空虚 LANG的 LC_ALL 坏/正常/ prefered?

Question 1:

Does the emptiness of LANG and LC_ALL bad/normal/prefered?

通常情况下,我不会太在意,但我已经有了一个警告

Normally, I wouldn't care that much about it, but I've got a warning

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

我使用 GTK (<一当

href=\"http://stackoverflow.com/questions/30705370/gtk-warning-locale-not-supported-by-c-library-using-the-fallback-c-local\">here's一个链接到我的previous quesiton这个)。

人们一直在努力,在许多语言这个问题(<一个href=\"http://stackoverflow.com/questions/20366533/gtk-warning-locale-not-supported-by-c-library-while-using-several-python-mo\">Python例如)和不同操作系统(<一个href=\"http://askubuntu.com/questions/359753/gtk-warning-locale-not-supported-by-c-library-when-starting-apps-from-th\">Ubuntu例如)。

People have been struggling with this problem in many languages (Python for example) and different OS (Ubuntu for example).

问题的关键是的我无法找到C语言和Mac OSX任何解决方案。

推荐答案

我猜想,GTK的警告是因为GTK实际上是试图使用从系统preferences在Mac语言和区域设置,使一个区域设置标识符字符串,使用字符串的setlocale(),并且被告知,C库不支持的语言环境。其结果是,它的默认为C区域。如果它没有试图找到更好的语言环境,将有多少理由警告说,它使用了C语言环境,因为这是可以预期当 LANG LC_ALL 都没有设置。

I would guess that the GTK warning is because GTK is actually trying to use the Mac language and locale settings from System Preferences to make a locale identifier string, using that string with setlocale(), and being told that the C library doesn't support that locale. As a result, it's defaulting to the "C" locale. If it weren't trying to find a better locale, there would be little reason to warn that it's using the "C" locale because that's what would be expected when LANG and LC_ALL are unset.

OS X上具有用于在高一级框架(可可等)许多语言和语言环境的支持,但不是所有这些也都支持在C库的水平。什么是系统preferences的语言和区域设置?你会期望你的语言和区域设置哪些区域设置标识符? ,看看是否能在输出​​是从区域设置-a (或类似地,如果有一个在为它目录/ usr / share / locale所)。

OS X has support for many languages and locales in the high-level frameworks (Cocoa, etc.), but not all of those are also supported at the level of the C library. What are the language and locale settings in System Preferences? What locale identifier would you expect for your language and locale? See if that's in the output from locale -a (or, similarly, if there's a directory for it in /usr/share/locale).

要检查的另一件事是终端的preferences。在设置面板中,高级选项卡下,在设置在启动时的语言环境变量设置?如果不是,那么这些环境变量将不会被默认设置,这或许可以解释你所看到的。如果启用该设置,但你仍然没有得到这些环境变量,这表明终端没能找到适合您的系统设置一个合适的C库的语言环境。

Another thing to check is Terminal's preferences. On the Settings pane, under the Advanced tab, is "Set locale environment variables on startup" set? If not, then those environment variables won't be set by default, which might explain what you're seeing. If the setting is enabled but you're still not getting those environment variables, that suggests that Terminal was not able to find a suitable C-library locale that matches your system settings.

最后,你可以简单地尝试设置 LANG 您要使用什么。例如:

Finally, you can simply try setting LANG to what you want to use. For example:

export LANG=pl_PL.UTF-8

这篇关于它是坏的LANG和LC_ALL运行`语言环境-a`在Mac OSX优山美地的时候是空的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆