diff options
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r-- | usr.bin/tmux/tmux.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c index 2c86f991bbd..e4685b7f657 100644 --- a/usr.bin/tmux/tmux.c +++ b/usr.bin/tmux/tmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.c,v 1.166 2016/03/01 12:02:54 nicm Exp $ */ +/* $OpenBSD: tmux.c,v 1.167 2016/03/05 07:44:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -188,9 +188,12 @@ main(int argc, char **argv) const char *s; int opt, flags, keys; - setlocale(LC_CTYPE, "en_US.UTF-8"); - setlocale(LC_TIME, ""); + if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) + setlocale(LC_CTYPE, ""); + if (wcwidth(0xfffd) != 1) + errx(1, "no UTF-8 locale; please set LC_CTYPE"); + setlocale(LC_TIME, ""); tzset(); if (**argv == '-') |