1
0
Fork 0
miniflux/http
Peter De Wachter 15505ee4a2 Make UTF-8 the default encoding for XML feeds
Consider the feed http://planet.haskell.org/atom.xml
- This is a UTF-8 encoded XML file
- No encoding declaration in the XML header
- No Unicode byte order mark
- Served with HTTP Content-Type "text/xml" (no charset parameter)

Miniflux lets charset.NewReader handle this. The charset package
implements the HTML5 character encoding algorithm, which, in this
situation, defaults to windows-1252 encoding if there are no UTF-8
characters in the first 1000 bytes. So for this feed, we get the wrong
encoding.

I inserted an explicit "utf8.Valid()" check, which fixes this problem.
2019-01-02 21:05:05 -08:00
..
client Make UTF-8 the default encoding for XML feeds 2019-01-02 21:05:05 -08:00
cookie Add missing package descriptions for GoDoc 2018-10-08 17:32:17 -07:00
request Make sure the remote address is populated even when using unix socket 2018-11-11 16:42:30 -08:00
response Remove charset=utf-8 from JSON responses 2018-11-03 12:03:06 -07:00
route Add missing package descriptions for GoDoc 2018-10-08 17:32:17 -07:00