diff options
author | Rob Landley <rob@landley.net> | 2020-12-06 00:02:46 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-12-06 00:02:46 -0600 |
commit | 75b89012c90470a27d66b54ad89901b94fcfd169 (patch) | |
tree | 07c1b6954a186511f016ca490c71ae0fbd2873f3 /main.c | |
parent | 0e675d98f3aba7a834dc56c2ae419f20da376f44 (diff) | |
download | toybox-75b89012c90470a27d66b54ad89901b94fcfd169.tar.gz |
Remove CONFIG_TOYBOX_I18N and just always support utf8.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -98,11 +98,10 @@ void toy_singleinit(struct toy_list *which, char *argv[]) if (!(which->flags & TOYFLAG_NOFORK)) { toys.old_umask = umask(0); if (!(which->flags & TOYFLAG_UMASK)) umask(toys.old_umask); - if (CFG_TOYBOX_I18N) { - // Deliberately try C.UTF-8 before the user's locale to work around users - // that choose non-UTF-8 locales. macOS doesn't support C.UTF-8 though. - if (!setlocale(LC_CTYPE, "C.UTF-8")) setlocale(LC_CTYPE, ""); - } + + // Try user's locale, falling back to C.UTF-8 + setlocale(LC_CTYPE, ""); + if (!strcmp("UTF-8", nl_langinfo(CODESET))) setlocale(LC_CTYPE, "C.UTF-8"); setlinebuf(stdout); } } |