Files
ports/textproc/linuxdoc-tools/files/patch-perl5lib_LinuxDocTools.pm
Tijl Coosemans 72b9da5ac9 textproc/linuxdoc-tools: Fix expand(1) locale
Add a patch so linuxdoc runs expand(1) with the right locale to
interpret multibyte characters.

PR:		295945
Exp-run by:	antoine
2026-06-30 22:03:56 +02:00

25 lines
896 B
Perl

--- perl5lib/LinuxDocTools.pm.orig 2023-06-12 16:57:27 UTC
+++ perl5lib/LinuxDocTools.pm
@@ -621,8 +621,20 @@ sub process_file {
}
}
+ my %EXPAND_locale = (
+ 'ascii' => 'C',
+ 'latin' => 'C',
+ 'latin1' => 'C',
+ 'utf-8' => 'C.UTF-8',
+ 'nippon' => 'ja_JP.eucJP',
+ 'euc-kr' => 'ko_KR.eucKR'
+ );
+ die "$error_header: Unkown character set $global->{charset}.\n"
+ unless exists $EXPAND_locale{$global->{charset}};
+ my $EXPAND_envvars = "LC_ALL=$EXPAND_locale{$global->{charset}}";
+
my $sgmlsasp_command = "$main::progs->{SGMLSASP} $mapping < $preaspout |
- expand -t $global->{tabsize} > $aspout";
+ $EXPAND_envvars expand -t $global->{tabsize} > $aspout";
ldt_log " ${error_header}::sgmlsasp_command:\n $sgmlsasp_command";
system ($sgmlsasp_command) == 0
or die "$error_header: Error running $sgmlsasp_command. Aborting ...\n";