Skip to content

Fix utf8 encoding of .pod files - #2126

Open
bduggan wants to merge 1 commit into
github:masterfrom
bduggan:fix_utf8_for_pod
Open

bduggan wants to merge 1 commit into
github:masterfrom
bduggan:fix_utf8_for_pod

Conversation

@bduggan

@bduggan bduggan commented Nov 8, 2026 •

Copy link
Copy Markdown

Add

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

inside pod2html, so that output is properly utf8 encoded.

Currently, some UTF-8 characters in pod files are producing mojibake when rendered as HTML on GitHub.

Example:

https://github.com/Raku/old-design-docs/blob/master/S03-operators.pod

X  Junctive and      & (&) ∩

but this should be

X  Junctive and      & (&) ∩

I also added a test -- note this uses =begin html because Pod::Simple 3.48 escapes ordinary text to ASCII entities.

See #1637 for another example.

Note that both of these examples start with =encoding utf8 which indicates utf-8 encoded text.

Add

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

inside pod2html, so that output is properly utf8 encoded.

Currently, some UTF-8 characters in pod files are producing mojibake
when rendered as HTML on Github.

Example:

https://github.com/Raku/old-design-docs/blob/master/S03-operators.pod

    X  Junctive and      & (&) ∩

but this should be

    X  Junctive and      & (&) ∩

I also added a test -- note this uses `=begin html` because Pod::Simple 3.48 escapes
ordinary text to ASCII entities.
@bduggan
bduggan marked this pull request as ready for review November 8, 2026 22:34
Copilot AI auto review requested due to automatic review settings November 8, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review records no active issues with the UTF-8 conversion change or its regression-test fixtures.

No open issues 🎉

What changed in this PR

This pull request fixes UTF-8 encoding for .pod files converted to HTML, preventing non-ASCII characters from appearing as mojibake.

Changes:

  • Enables UTF-8 encoding for pod2html output.
  • Adds a POD fixture containing representative Unicode characters.
  • Adds the expected UTF-8 HTML rendering.
File Description
test/​markups/​README.utf8.pod.html Adds expected UTF-8 HTML output.
test/​markups/​README.utf8.pod Adds Unicode regression-test input.
lib/​github/​commands/​pod2html Enables UTF-8 encoding for generated HTML output.

This pull request is too complex or risky for automated approval.

Review effort: Lite (auto)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants