git: be0236ebd857 - main - tzsetup: Fix unicode support

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Fri, 17 Dec 2021 08:43:52 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=be0236ebd857579e745cd13fef3c96c406065de3

commit be0236ebd857579e745cd13fef3c96c406065de3
Author:     Alfonso Siciliano <alfsiciliano@gmail.com>
AuthorDate: 2021-12-17 08:25:07 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2021-12-17 08:25:07 +0000

    tzsetup: Fix unicode support
    
    Differential revision:  https://reviews.freebsd.org/D33532
---
 usr.sbin/tzsetup/tzsetup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index d271d6377347..5b77d6016035 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef HAVE_BSDDIALOG
 #include <bsddialog.h>
+#include <locale.h>
 #endif
 
 #define	_PATH_ZONETAB		"/usr/share/zoneinfo/zone1970.tab"
@@ -868,6 +869,10 @@ main(int argc, char **argv)
 
 	skiputc = 0;
 
+#ifdef HAVE_BSDDIALOG
+	setlocale(LC_ALL, "");
+#endif
+
 	/* Default skiputc to 1 for VM guests */
 	if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
 	    strcmp(vm_guest, "none") != 0)