Skip to content

Commit bba27c4

Browse files
committed
fix: fix encoding of xml
1 parent 933154a commit bba27c4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

genrss/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,6 @@ def xml(self, pretty: bool = False) -> str:
239239
"""
240240
root = self.to_element()
241241

242-
return '<?xml version="1.0" encoding="UTF-8"?>\n' \
243-
+ ('\n' if pretty else '') \
244-
+ tostring(root, pretty_print=pretty).decode('utf-8')
242+
return tostring(root, pretty_print=pretty, xml_declaration=True,
243+
encoding='UTF-8').\
244+
decode('utf-8')

tests/test_rss.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_feed_description(description, expose):
4040

4141

4242
@pytest.mark.parametrize('copyright, expose', [
43-
pytest.param('copyright © genrss', 'copyright &#169; genrss', id='copy'),
43+
pytest.param('copyright © genrss', 'copyright © genrss', id='copy'),
4444
])
4545
def test_feed_copyright(copyright, expose):
4646
feed = create_rss(copyright=copyright)

0 commit comments

Comments
 (0)