Skip to content

Commit

Permalink
fix: fix encoding of xml
Browse files Browse the repository at this point in the history
  • Loading branch information
pleshevskiy committed Jul 30, 2019
1 parent 933154a commit bba27c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions genrss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,6 @@ def xml(self, pretty: bool = False) -> str:
"""
root = self.to_element()

return '<?xml version="1.0" encoding="UTF-8"?>\n' \
+ ('\n' if pretty else '') \
+ tostring(root, pretty_print=pretty).decode('utf-8')
return tostring(root, pretty_print=pretty, xml_declaration=True,
encoding='UTF-8').\
decode('utf-8')
2 changes: 1 addition & 1 deletion tests/test_rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_feed_description(description, expose):


@pytest.mark.parametrize('copyright, expose', [
pytest.param('copyright © genrss', 'copyright &#169; genrss', id='copy'),
pytest.param('copyright © genrss', 'copyright © genrss', id='copy'),
])
def test_feed_copyright(copyright, expose):
feed = create_rss(copyright=copyright)
Expand Down

0 comments on commit bba27c4

Please sign in to comment.