diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-07-31 09:29:13 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-07-31 09:29:13 +0000 |
commit | 89a1a1be54eefe77cc04401526ea22323c644115 (patch) | |
tree | 8071c288f5714fd1fbb80b7a53e500e58014b3e7 /term_ascii.c | |
parent | 7f6377086cfbc884dfcb75e0a4075d0f0cf8b73d (diff) | |
download | mandoc-89a1a1be54eefe77cc04401526ea22323c644115.tar.gz mandoc-89a1a1be54eefe77cc04401526ea22323c644115.tar.zst mandoc-89a1a1be54eefe77cc04401526ea22323c644115.zip |
Autodetect a suitable locale for -Tutf8 mode,
and allow overriding it manually.
Based on a patch from Svyatoslav Mishyn <juef at openmailbox dot org>
tweaked by me.
The idea originally came up in a conversation with Markus Waldeck.
Diffstat (limited to 'term_ascii.c')
-rw-r--r-- | term_ascii.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/term_ascii.c b/term_ascii.c index fecdb0a9..df5ff139 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -1,4 +1,4 @@ -/* $Id: term_ascii.c,v 1.53 2016/07/08 22:29:05 schwarze Exp $ */ +/* $Id: term_ascii.c,v 1.54 2016/07/31 09:29:13 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -98,7 +98,7 @@ ascii_init(enum termenc enc, const struct manoutput *outopts) v = TERMENC_LOCALE == enc ? setlocale(LC_CTYPE, "") : - setlocale(LC_CTYPE, "en_US.UTF-8"); + setlocale(LC_CTYPE, UTF8_LOCALE); if (NULL != v && MB_CUR_MAX > 1) { p->enc = enc; p->advance = locale_advance; |