Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Encode canonical charset names differ from Perl, breaking IO::HTML

未关闭
#1,445 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, perl
领域
backend

调研方向

从 PerlOnJava 的 Encode 实现及其现有兼容性测试入手,然后在 JVM 和解释器后端上重现 canonical-name 失败。为 ISO-8859-15 和 cp1252 映射添加针对性的回归测试覆盖,并验证 IO::HTML 1.004 测试套件在两个后端上都能通过。

由索引模型根据 Issue 内容生成。

描述

area:cpan-port area:unicode bug

Summary

IO::HTML 1.004 passes its complete upstream test suite under system Perl but fails 23 of 165 tests under PerlOnJava because Encode::find_encoding(...)->name returns Java-style charset names instead of Perl's canonical names.

Reproduction

CPAN random tester run: 20260918-141920-96054

Distribution: IO::HTML 1.004

System Perl 5.42.2:

All tests successful.
Files=5, Tests=165
Result: PASS

PerlOnJava JVM backend:

Files=5, Tests=165
Result: FAIL
Failed 2/5 test programs. 23/165 subtests failed.

The interpreter backend reproduces the same 23 failures.

Failing tests

  • t/10-find.t: 14 failures
  • t/20-open.t: 9 failures
  • t/00-all_prereqs.t, t/00-load.t, and t/30-outfile.t: pass

The failures are all charset-name mismatches:

got:      ISO-8859-15
expected: iso-8859-15

got:      windows-1252
expected: cp1252

The affected inputs include HTML declarations for ISO-8859-15 and ISO-8859-1, including declarations near the 1024-byte scan boundary.

Likely cause

IO::HTML calls Encode::find_encoding($charset) and then uses the returned object's name method. Perl returns Encode's canonical names (iso-8859-15 and cp1252), while PerlOnJava returns Java canonical charset names (ISO-8859-15 and windows-1252).

The PerlOnJava Encode implementation already maps US-ASCII to ascii and UTF-8 to utf-8-strict, but otherwise returns the Java charset name unchanged. The canonical-name mapping needs to cover the relevant Perl aliases and should preserve the expected behavior for both backends.

Expected behavior

For equivalent Encode::find_encoding calls, PerlOnJava should return an Encode::Encoding object whose name matches Perl's canonical name, including at least:

  • ISO-8859-15 -> iso-8859-15
  • windows-1252 / ISO-8859-1 -> cp1252

Please add focused regression coverage for the canonical names and verify IO::HTML 1.004 on both the JVM and interpreter backends after the fix.

Related project context

The project module-compatibility notes already identify encoding-name case/alias normalization as an outstanding Encode compatibility gap affecting IO::HTML. This report provides a complete upstream reproduction and confirms the defect on both PerlOnJava execution backends.

主要语言
Perl
星标
64
派生
6
平均合并
5 小时 11 分钟
30 天内合并 PR
168

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。