Encode canonical charset names differ from Perl, breaking IO::HTML
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Bắt đầu với triển khai Encode của PerlOnJava và các bài kiểm tra tương thích hiện có, sau đó tái hiện các lỗi canonical-name trên cả backend JVM và backend trình thông dịch. Bổ sung phạm vi kiểm thử hồi quy tập trung cho các ánh xạ ISO-8859-15 và cp1252, đồng thời xác minh rằng bộ kiểm thử IO::HTML 1.004 vượt qua trên cả hai backend.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 failurest/20-open.t: 9 failurest/00-all_prereqs.t,t/00-load.t, andt/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-15windows-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.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 6
- Merge trung bình
- 5 giờ 38 phút
- Pull request đã merge (30 ngày)
- 170
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1511 ·
-
area:backend area:cpan-port bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1508 · 1 bình luận ·
-
Port IPC::SysV (low priority) Đang mởarea:cpan-port area:platform enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
fglock/PerlOnJava#1507 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fglock/PerlOnJava#1506 ·
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
documentation Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
trizen/youtube-viewer#456 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
connectivity Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100