XML::LibXML string parsing mishandles declared encodings
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Start with src/main/java/org/perlonjava/runtime/perlmodule/XMLLibXML.java, especially xmlInputSource(), and trace how string inputs reach the XML parser. Use the reported failures in t/02gateway.t and the fixtures with ISO-8859-1 declarations as evidence; verify declared-encoding strings, decoded character strings, and BOM-marked byte strings against system Perl behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
PerlOnJava's bundled XML::LibXML returns incorrect character data when parsing the PagSeguro XML fixtures used by Business::CPI::Gateway::PagSeguro 0.904. The upstream distribution passes all 17 tests under system Perl, but fails 3 assertions under PerlOnJava in t/02gateway.t.
Reproduction evidence
CPAN random tester run 20261106-154847-45334:
t/02gateway.tfailures:notification for completed transaction,notification for failed transaction, andit parses the file correctly.- Notification payer name: PerlOnJava returns
Jo\uFFFDo da Silva; expected UTF-8 bytes forJoão da Silva. - Transaction payer name: PerlOnJava returns
José Comprador; expectedJosé Comprador, matching the system Perl result for the fixture's declared encoding. - System Perl oracle: all 17 tests pass, including
t/02gateway.t.
The fixtures declare encoding="ISO-8859-1" while containing UTF-8 byte sequences for the accented names. The parser implementation in src/main/java/org/perlonjava/runtime/perlmodule/XMLLibXML.java sends most string inputs to a StringReader in xmlInputSource(). That character-based path bypasses XML byte decoding according to the declaration. The transaction mismatch directly reflects this; the replacement character in notification parsing also points to byte/character conversion on that path and should be covered while fixing it.
Expected behavior
Match system XML::LibXML behavior for string input carrying an XML encoding declaration, including these upstream cases. Preserve correct behavior for already-decoded character strings and BOM-marked byte strings.
Context
The target distribution is pure Perl and uses XML::LibXML; the failing implementation is PerlOnJava's bundled Java provider. No distribution source or tests were modified during classification.
- Vorherrschende Sprache
- Perl
- Sterne
- 65
- Forks
- 8
- Ø Merge
- 5 Std. 57 Min.
- Gemergte PRs (30 T.)
- 177
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus fglock/PerlOnJava
-
area:runtime documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
fglock/PerlOnJava#1579 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Honor scalar context for sort returned from a subroutineEvtl. vergeben @fglock hat das heute übernommen. Offenarea:runtime bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
fglock/PerlOnJava#1991 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:cpan-port area:parser bug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
fglock/PerlOnJava#1990 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:backend bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
fglock/PerlOnJava#1981 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:runtime bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 57/100
fglock/PerlOnJava#1980 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in fglock/PerlOnJava
Ähnliche Issues
-
check_keywords.pl dies before reporting an unknown keyword categoryEvtl. vergeben @zhaohai666 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 87/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
wave-followup
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100