aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-07-02 17:30:23 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2013-07-02 17:30:23 +0200
commit3e7ecb179b193bf17323c975890eed1d025f7e4c (patch)
tree99b869b4f6fa759aacb2c8e12464797c9e930a3d /libbb
parentea267d518ff55517e174b9e8514fc521e4a3b41e (diff)
downloadbusybox-3e7ecb179b193bf17323c975890eed1d025f7e4c.tar.gz
unicode: check $LC_ALL to detect Unicode mode, not only $LANG
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/unicode.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbb/unicode.c b/libbb/unicode.c
index 99dc1dfa6..c1e3966fe 100644
--- a/libbb/unicode.c
+++ b/libbb/unicode.c
@@ -39,8 +39,11 @@ void FAST_FUNC reinit_unicode(const char *LANG)
void FAST_FUNC init_unicode(void)
{
- if (unicode_status == UNICODE_UNKNOWN)
- reinit_unicode(getenv("LANG"));
+ if (unicode_status == UNICODE_UNKNOWN) {
+ char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LANG");
+ reinit_unicode(s);
+ }
}
#else
@@ -58,8 +61,11 @@ void FAST_FUNC reinit_unicode(const char *LANG)
void FAST_FUNC init_unicode(void)
{
- if (unicode_status == UNICODE_UNKNOWN)
- reinit_unicode(getenv("LANG"));
+ if (unicode_status == UNICODE_UNKNOWN) {
+ char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LANG");
+ reinit_unicode(s);
+ }
}
# endif