aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-10-21 09:48:24 -0500
committerRob Landley <rob@landley.net>2017-10-21 09:48:24 -0500
commitb5e405ce448fd50988346cc42a9099a5fdbafe8d (patch)
tree7acba4c2da278c3eb7bffc13320631177de8eef2
parent5af26a03df96cdea056440355713182cab4a4242 (diff)
downloadtoybox-b5e405ce448fd50988346cc42a9099a5fdbafe8d.tar.gz
Use setlocale(LC_CTYPE, "C.UTF-8") for more targeted locale enable:
(only enable character parsing, force utf8, "C" semantics otherwise.)
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 3c80a998..0b77b508 100644
--- a/main.c
+++ b/main.c
@@ -83,7 +83,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[])
toys.which = which;
toys.argv = argv;
- if (CFG_TOYBOX_I18N) setlocale(LC_ALL, "C"+!!(which->flags & TOYFLAG_LOCALE));
+ if (CFG_TOYBOX_I18N) setlocale(LC_CTYPE, "C.UTF-8");
// Parse --help and --version for (almost) all commands
if (CFG_TOYBOX_HELP_DASHDASH && !(which->flags & TOYFLAG_NOHELP) && argv[1]) {