diff --git a/product/ERP5OOo/FormPrintout.py b/product/ERP5OOo/FormPrintout.py index 0e4959e8bb313523e66facf4cf499f5d44073e67..f99ed8c61742106821ddb9dd8b6ca424fc6978ae 100644 --- a/product/ERP5OOo/FormPrintout.py +++ b/product/ERP5OOo/FormPrintout.py @@ -242,7 +242,7 @@ class FormPrintout(Implicit, Persistent, RoleManager, Item): format = REQUEST.get('format', None) if format is None: if REQUEST is not None: - REQUEST.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % content_type) + REQUEST.RESPONSE.setHeader('Content-Type','%s' % content_type) REQUEST.RESPONSE.setHeader('Content-disposition', 'inline;filename="%s%s"' % (self.title_or_id(), guess_extension(content_type))) return printout diff --git a/product/ERP5OOo/tests/testFormPrintoutAsODT.py b/product/ERP5OOo/tests/testFormPrintoutAsODT.py index 80f2f390853616af8cc2f09125673c1fcb69be5d..36bf38067f2bee0ff8bc3bf81393770f0695fd5e 100644 --- a/product/ERP5OOo/tests/testFormPrintoutAsODT.py +++ b/product/ERP5OOo/tests/testFormPrintoutAsODT.py @@ -155,7 +155,7 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): content_xml = builder.extract("content.xml") self.assertTrue(content_xml.find("Foo title!") > 0) self.assertEqual(request.RESPONSE.getHeader('content-type'), - 'application/vnd.oasis.opendocument.text; charset=utf-8') + 'application/vnd.oasis.opendocument.text') self.assertEqual(request.RESPONSE.getHeader('content-disposition'), 'inline;filename="Foo_viewAsPrintout.odt"') self._validate(odf_document) @@ -206,8 +206,7 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): builder = OOoBuilder(odf_document) content_xml = builder.extract("content.xml") self.assertTrue(content_xml.find("call!") > 0) - # when just call FormPrintout, it does not change content-type - self.assertEqual(request.RESPONSE.getHeader('content-type'), 'text/html') + self.assertEqual(request.RESPONSE.getHeader('content-type'), 'application/vnd.oasis.opendocument.text') self._validate(odf_document) # 5. Normal case: utf-8 string