Open rkfg opened 6 years ago
The client bug is https://github.com/vector-im/riot-web/issues/5473
also happends on android it seems
This ought to work as intended next version, although malformed pages may fail the heuristics we've put in to detect when the http-equiv meta tag is being used. For the given examples, though, it should all work fine.
I tested this exact URL on matrix.org just now and it still shows wrongly encoded text, can we reopen this please?
Synapse would detect the correct encoding, except the <meta http-equiv="Content-Type" ...
declaration for that particular URL lies just outside of Synapse's 1024 byte cutoff.
Description
Wrong text encoding is used in the preview text on some sites.
Steps to reproduce
"Ïåðâûé êàíàë" îïðîâåðã èíôîðìàöèþ îá óõîäå Åêàòåðèíû Àíäðååâîé èç ïðîãðàììû "Âðåìÿ" - Interfax.ru Àíäðååâà âåäåò ïðîãðàììó áîëåå 20 ëåò è âñå åùå îñòàåòñÿ åå âåäóùåé
which is obviously wrong, it's CP-1251 text decoded as CP-1252. The page contains<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
so browsers display it fine.В России - Новости Интерфакс Новости в России.
The difference seems to be in the response headers. Where the text is decoded correctly the Content-Type returned by the server is
text/html; Charset=windows-1251
. Where it's wrong it's justtext/html
. I think thehttp-equiv
value should have precedence over the header (if it's parsed at all).Version information