XML::LibXML string parsing mishandles declared encodings
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Perl
- Estrelas
- 65
- Forks
- 8
- Merge médio
- 5h 57min
- PRs com merge (30d)
- 177
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fglock/PerlOnJava
-
area:runtime documentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#1579 ·
Mantenedores costumam responder em até 1 dia
-
Honor scalar context for sort returned from a subroutineTalvez já em andamento @fglock assumiu hoje. Abertaarea:runtime bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
fglock/PerlOnJava#1991 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port area:parser bug
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
fglock/PerlOnJava#1990 ·
Mantenedores costumam responder em até 1 dia
-
area:backend bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
fglock/PerlOnJava#1981 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:runtime bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 57/100
fglock/PerlOnJava#1980 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fglock/PerlOnJava
Issues semelhantes
-
check_keywords.pl dies before reporting an unknown keyword categoryTalvez já em andamento @zhaohai666 assumiu há 1 dia. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 87/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
wave-followup
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100