improve unicode handling and rss detection

This commit is contained in:
Lionel Dricot 2022-02-14 11:54:51 +01:00
parent e1ab504f69
commit 5cf26e28fa
1 changed files with 5 additions and 1 deletions

View File

@ -757,6 +757,9 @@ _FORMAT_RENDERERS = {
"text/gemini": GemtextRenderer,
"text/html" : HtmlRenderer,
"text/xml" : FeedRenderer,
"application/xml" : FeedRenderer,
"application/rss+xml" : FeedRenderer,
"application/atom+xml" : FeedRenderer,
"text/gopher": GopherRenderer,
"image/*": ImageRenderer
}
@ -1474,7 +1477,8 @@ class GeminiClient(cmd.Cmd):
mime = response.headers['content-type']
body = response.content
if "text/" in mime:
body = response.text
#body = response.text
body = response.content.decode("UTF-8","replace")
else:
body = response.content
gi.write_body(body,mime)