diff --git a/debexpo/controllers/sponsor.py b/debexpo/controllers/sponsor.py index 88fff629f3ce78bb3f0d772baf0d92e814be2ef1..cffae857e1ea323f42f6636faab7708386ee44c6 100644 --- a/debexpo/controllers/sponsor.py +++ b/debexpo/controllers/sponsor.py @@ -327,7 +327,8 @@ class SponsorController(BaseController): # This is a workaround for Thunderbird and some other clients # not handling properly '+' in the mailto body parameter. c.mailbody = render('/sponsor/rfs_template.mako') - c.mailbody = urllib.quote_plus(c.mailbody).replace('+', '%20') + c.mailbody = urllib.quote_plus(c.mailbody.encode('utf-8')) \ + .replace('+', '%20') return render('/sponsor/rfs_howto.mako') diff --git a/debexpo/tests/importer/plugins/test_rfstemplate.py b/debexpo/tests/importer/plugins/test_rfstemplate.py index 7915d2800649b364cab942a04076e4df208d886c..8249ca0cc4538ce285d96aec720900541bf761ba 100644 --- a/debexpo/tests/importer/plugins/test_rfstemplate.py +++ b/debexpo/tests/importer/plugins/test_rfstemplate.py @@ -40,6 +40,17 @@ class TestPluginRFSTemplate(TestImporterController): def __init__(self, *args, **kwargs): TestImporterController.__init__(self, *args, **kwargs) + def test_utf8_changelog(self): + self.import_source_package('hello-utf8-changelog') + self.assert_importer_succeeded() + self.assert_package_severity('hello', 'rfstemplate', + PLUGIN_SEVERITY_INFO) + self.assert_rfs_content('hello', + 'Subject: RFS: hello/1.0-1 -- Test package for ' + 'debexpo') + self.assert_rfs_content('hello', + 'Severity: normal') + def test_dep5_license(self): self.import_source_package('hello') self.assert_importer_succeeded() diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/changelog b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..3552cc78d5fc525e92dcc6554578e0493ddb31de --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/changelog @@ -0,0 +1,6 @@ +hello (1.0-1) unstable; urgency=medium + + * This is an UTF-8 changelog entry: é,ü,Й + * Initial release (Closes: #0) + + -- Vincent TIME Sun, 02 Dec 2018 22:38:11 +0100 diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/compat b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/compat new file mode 120000 index 0000000000000000000000000000000000000000..ea4b992cffccf3c1676acbb911bcf71c987d0a84 --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/compat @@ -0,0 +1 @@ +../../hello/debian/compat \ No newline at end of file diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/control b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/control new file mode 120000 index 0000000000000000000000000000000000000000..ab5561cd43ce71647585d0706262e5493a187183 --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/control @@ -0,0 +1 @@ +../../hello/debian/control \ No newline at end of file diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/copyright b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/copyright new file mode 120000 index 0000000000000000000000000000000000000000..70d117c0a7d2a22aba745d38bb2ef884de985b98 --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/copyright @@ -0,0 +1 @@ +../../hello/debian/copyright \ No newline at end of file diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/rules b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/rules new file mode 120000 index 0000000000000000000000000000000000000000..05451293677e5a65fb8da33a389e965acbde7f10 --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/rules @@ -0,0 +1 @@ +../../hello/debian/rules \ No newline at end of file diff --git a/debexpo/tests/importer/sources/hello-utf8-changelog/debian/source b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/source new file mode 120000 index 0000000000000000000000000000000000000000..0f8a69b5b04e945bc653c410a407bf65b5987662 --- /dev/null +++ b/debexpo/tests/importer/sources/hello-utf8-changelog/debian/source @@ -0,0 +1 @@ +../../hello/debian/source \ No newline at end of file