#1036357 use C.UTF8 as default locale

Package:
help2man
Source:
help2man
Description:
Automatic manpage generator
Submitter:
Johannes Schauer Marin Rodrigues
Date:
2023-05-19 15:27:03 UTC
Severity:
normal
Tags:
#1036357#5
Date:
2023-05-19 15:25:03 UTC
From:
To:
Hi,

the current default locale is C. This means that any non-ascii character
will show up as "??" in the resulting man page. By letting the default
locale be "C.UTF8", unicode characters will be treated correctly.
Attached is a patch.

Thanks!

cheers, josch
--- help2man	2023-05-19 17:22:30.716019650 +0200
+++ help2man.new	2023-05-19 17:22:44.087768889 +0200
@@ -78,7 +78,7 @@
     sub configure_locale
     {
 	delete @ENV{qw(LANGUAGE LC_MESSAGES LANG)};
-	setlocale LC_ALL, $ENV{LC_ALL} = shift || 'C';
+	setlocale LC_ALL, $ENV{LC_ALL} = shift || 'C.UTF8';
 	my $encoding = langinfo CODESET;
 	$encoder = (find_encoding $encoding) || fallback->new($encoding);
     }