Description: Keep raw UTF-8 in Pod-generated HTML Pod::Simple >= 3.48 escapes non-ASCII characters as numeric entities even when HTML::Entities is disabled (perl-pod/pod-simple pull request #189), while older versions emit them raw. The Pod parser promises raw UTF-8 output, so pin html_encode_chars to only the five HTML special characters (&<>"'). This keeps the output stable (and raw UTF-8) regardless of the Pod::Simple version. Bug: https://github.com/theory/text-markup/issues/31 Forwarded: https://github.com/theory/text-markup/issues/31 Bug-Debian: https://bugs.debian.org/1141361 Author: gregor herrmann Last-Update: 2026-09-25 Assisted-By: DeepSeek V4 Flash 0731 --- a/lib/Text/Markup/Pod.pm +++ b/lib/Text/Markup/Pod.pm @@ -22,6 +22,11 @@ # Output everything as UTF-8. $p->html_header_tags(''); $p->strip_verbatim_indent(sub { (sort map { /^(\s+)/ } @{$_[0]})[0] }); + # Explicitly escape only the five HTML special characters; non-ASCII + # characters remain raw UTF-8. Pod::Simple >= 3.48 escapes all non-ASCII + # characters by default (perl-pod/pod-simple#188), which would change this + # module's documented raw-UTF-8 output. + $p->html_encode_chars(q{&<>"'}) if $p->can('html_encode_chars'); $p->output_string(\my $html); # Want user supplied options to override even these default behaviors, # if necessary