diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/unicode.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libbb/unicode.c b/libbb/unicode.c index 99dc1df..c1e3966 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 |