Skip to content

Fix Pod::Spell by loading Encode for encoding layers#869

Open
fglock wants to merge 1 commit into
masterfrom
fix/pod-spell-errors
Open

Fix Pod::Spell by loading Encode for encoding layers#869
fglock wants to merge 1 commit into
masterfrom
fix/pod-spell-errors

Conversation

@fglock

@fglock fglock commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • load Encode.pm when applying a PerlIO :encoding(...) layer
  • match the visible side effect provided by standard Perl's PerlIO::encoding
  • add a regression test covering Encode::encode availability

Root cause

Pod::Wordlist opens its bundled wordlist with :encoding(UTF-8).
Standard Perl loads Encode while applying that layer, and Pod::Spell
later calls Encode::encode. PerlOnJava performed the charset conversion
directly without loading Encode, so the call was undefined.

Test plan

  • prove src/test/resources/unit/perlio_encoding_loads_encode.t
  • ./jperl src/test/resources/unit/perlio_encoding_loads_encode.t
  • minimal interpreter-backend parity check
  • ./jcpan Pod::Spell — all 8 test files and 54 tests pass; install succeeds
  • make — compilation and 223 unit tests passed, then the unrelated existing
    unit/refcount/weaken_edge_cases.t test 37 failed; the same failure reproduces
    when that test is run standalone

Generated with Codex

Match Perl's visible side effect of loading Encode when an
:encoding(...) layer is applied. Pod::Spell relies on this after its
wordlist is opened as UTF-8.

Add a focused regression test for Encode::encode availability.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
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.

1 participant