Commit eaf92072 authored by 's avatar

- made sure getConfiguration().default_zpublisher_encoding is set correctly

parent a904f4f1
...@@ -10,7 +10,9 @@ http://docs.zope.org/zope2/releases/. ...@@ -10,7 +10,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed Bugs Fixed
++++++++++ ++++++++++
- Made sure getConfiguration().default_zpublisher_encoding is set correctly.
- LP #713253: Prevent publication of acquired attributes, where the acquired - LP #713253: Prevent publication of acquired attributes, where the acquired
object does not have a docstring. object does not have a docstring.
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE. # FOR A PARTICULAR PURPOSE.
# #
############################################################################## ##############################################################################
"""Datatypes for the Zope schema for use with ZConfig.""" """Datatypes for the Zope schema for use with ZConfig."""
import os import os
...@@ -228,7 +227,7 @@ class ZopeDatabase(ZODBDatabase): ...@@ -228,7 +227,7 @@ class ZopeDatabase(ZODBDatabase):
container_class = 'OFS.Folder.Folder' container_class = 'OFS.Folder.Folder'
return (real_root, real_path, container_class) return (real_root, real_path, container_class)
raise LookupError('Nothing known about mount path %s' % mount_path) raise LookupError('Nothing known about mount path %s' % mount_path)
def default_zpublisher_encoding(value): def default_zpublisher_encoding(value):
# This is a bit clunky but necessary :-( # This is a bit clunky but necessary :-(
# These modules are imported during the configuration process # These modules are imported during the configuration process
...@@ -239,6 +238,7 @@ def default_zpublisher_encoding(value): ...@@ -239,6 +238,7 @@ def default_zpublisher_encoding(value):
Converters.default_encoding = value Converters.default_encoding = value
HTTPRequest.default_encoding = value HTTPRequest.default_encoding = value
HTTPResponse.default_encoding = value HTTPResponse.default_encoding = value
return value
class DBTab: class DBTab:
"""A Zope database configuration, similar in purpose to /etc/fstab. """A Zope database configuration, similar in purpose to /etc/fstab.
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE. # FOR A PARTICULAR PURPOSE.
# #
############################################################################## ##############################################################################
"""Test that the Zope schema can be loaded.""" """Test that the Zope schema can be loaded."""
import os import os
...@@ -221,5 +220,18 @@ class StartupTestCase(unittest.TestCase): ...@@ -221,5 +220,18 @@ class StartupTestCase(unittest.TestCase):
""") """)
self.assertEqual(conf.max_conflict_retries, 15) self.assertEqual(conf.max_conflict_retries, 15)
def test_default_zpublisher_encoding(self):
conf, dummy = self.load_config_text("""\
instancehome <<INSTANCE_HOME>>
""")
self.assertEqual(conf.default_zpublisher_encoding, 'iso-8859-15')
conf, dummy = self.load_config_text("""\
instancehome <<INSTANCE_HOME>>
default-zpublisher-encoding utf-8
""")
self.assertEqual(conf.default_zpublisher_encoding, 'utf-8')
def test_suite(): def test_suite():
return unittest.makeSuite(StartupTestCase) return unittest.makeSuite(StartupTestCase)
...@@ -877,12 +877,13 @@ ...@@ -877,12 +877,13 @@
<section type="zoperunner" name="*" attribute="runner"/> <section type="zoperunner" name="*" attribute="runner"/>
<key name="default-zpublisher-encoding" datatype=".default_zpublisher_encoding"> <key name="default-zpublisher-encoding"
datatype=".default_zpublisher_encoding"
default="iso-8859-15">
<description> <description>
This key controls what character set is used to encode unicode This key controls what character set is used to encode unicode
data that reaches ZPublisher without any other specified encoding. data that reaches ZPublisher without any other specified encoding.
</description> </description>
<metadefault>iso-8859-15</metadefault>
</key> </key>
<abstracttype name="zope.product.base"> <abstracttype name="zope.product.base">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment