Skip to content

Pod::Simple::XHTML doesn't escape non-ASCII characters when HTML::Entities isn't installed #188

@xenu

Description

@xenu
use strict;
use warnings;
use Pod::Simple::XHTML;

STDOUT->binmode(':encoding(UTF-8)');

# pretend that HTML::Entities isn't installed
$Pod::Simple::XHTML::HAS_HTML_ENTITIES = 0;

my $p = Pod::Simple::XHTML->new;
$p->parse_file(\*DATA);

__DATA__
=encoding utf8

=head1 NAME

ąść

=cut

The above code outputs "ąść" literally. When you flip $Pod::Simple::XHTML::HAS_HTML_ENTITIES to 1, non-ASCII characters get escaped using HTML entities.

Pod::Simple::XHTML should escape the same set of characters regardless of whether HTML::Entities is installed or not.

BTW, this bug is the most likely reason why GitHub doesn't render non-ASCII characters in Pod documents correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions