aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/unicode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/unicode.c b/libbb/unicode.c
index c1e3966fe..35e88d307 100644
--- a/libbb/unicode.c
+++ b/libbb/unicode.c
@@ -39,8 +39,15 @@ void FAST_FUNC reinit_unicode(const char *LANG)
void FAST_FUNC init_unicode(void)
{
+ /* Some people set only $LC_CTYPE, not $LC_ALL, because they want
+ * only Unicode to be activated on their system, not the whole
+ * shebang of wrong decimal points, strange date formats and so on.
+ *
+ * TODO? Maybe we should use LC_CTYPE instead of LC_ALL in setlocale()?
+ */
if (unicode_status == UNICODE_UNKNOWN) {
char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LC_CTYPE");
if (!s) s = getenv("LANG");
reinit_unicode(s);
}
@@ -63,6 +70,7 @@ void FAST_FUNC init_unicode(void)
{
if (unicode_status == UNICODE_UNKNOWN) {
char *s = getenv("LC_ALL");
+ if (!s) s = getenv("LC_CTYPE");
if (!s) s = getenv("LANG");
reinit_unicode(s);
}