Encoding detection unpredictable
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- backend, testing-qa
Direzione di ricerca
Inizia eseguendo il server di validazione con java -cp vnu.jar nu.validator.servlet.Main 8888, quindi riproduci il report usando il testCase.txt collegato e il comando ApacheBench. Confronta le risposte concorrenti per il rilevamento intermittente di “big5” e il messaggio “Unmappable byte sequence”. Il lavoro è completato quando validazioni concorrenti ripetute producono un rilevamento prevedibile del charset senza il risultato sporadico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When validating multiple files in concurrency, the encoding detection is not always predictable.
The easiest way to explain is probably to reproduce my test case:
- launch the validation server (15.6.29)
java -cp vnu.jar nu.validator.servlet.Main 8888
- get the test case file (this file contains an unbreakable space and doesn't specify a content type in a meta header): https://gist.githubusercontent.com/marob/d8f9cb25a64b3905616e/raw/c521f951a70518815dd380a2d3a038f1ab2f9bbb/testCase.txt
- validate this file with concurrency and grep results on "Unmappable" keyword:
ab -T"text/html; encoding=utf-8" -p testCase.txt -c 100 -n 10000 -v 4 http://localhost:8888/?out=json | grep Unmappable
You should obtain some results of the form (if not, try to restart the server and re-validate):
{"messages":[{"type":"info","message":"The Content-Type was “text/html”. Using the HTML parser."},{"type":"error","message":"The character encoding was not declared. Proceeding using “big5”."},{"type":"error","lastLine":7,"lastColumn":47,"message":"Unmappable byte sequence: “c2”, “a0”."},{"type":"info","message":"Using the schema for HTML5 + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1."}]}
As you can see, the detected encoding is sometimes "big5", but only once or twice among thousands... hence the unpredictability.
When this encoding is detected, the unbreakable space triggers the "Unmappable byte sequence" error.
I think the charset detection should be predictable.
My test demonstrate it is not.
Regards
- Lingua principale
- Java
- Stelle
- 65
- Fork
- 29
- Merge medio
- 11g 21h
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di validator/htmlparser
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
validator/htmlparser#98 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
validator/htmlparser#96 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
validator/htmlparser#95 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
validator/htmlparser#87 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
validator/htmlparser#79 ·
Tutte le issue di validator/htmlparser
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/gradle-plugins#157 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cryptomator/hub#497 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
johanhaleby/occurrent#1120 ·