Skip to content

Commit

Permalink
Pull default_charset from registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
esteele committed Sep 19, 2015
1 parent 19e6a05 commit dd443d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changelog
2.1.22 (unreleased)
-------------------

- Nothing changed yet.

- Pull default_charset value from the configuration registry.
[esteele]

2.1.21 (2015-09-07)
-------------------
Expand Down
9 changes: 4 additions & 5 deletions plone/app/vocabularies/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from plone.app.querystring import queryparser
from plone.app.vocabularies import SlicableVocabulary
from plone.app.vocabularies.terms import BrowsableTerm
from plone.registry.interfaces import IRegistry
from plone.uuid.interfaces import IUUID
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import safe_unicode
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.ZCTextIndex.ParseTree import ParseError
from zope.browser.interfaces import ITerms
from zope.component import getUtility
from zope.formlib.interfaces import ISourceQueryView
from zope.interface import implementer
from zope.interface import provider
Expand Down Expand Up @@ -149,11 +151,8 @@ def __init__(self, context, base_query={}, default_query=None):
self.catalog = getToolByName(context, "portal_catalog")
self.portal_tool = getToolByName(context, "portal_url")
self.portal_path = self.portal_tool.getPortalPath()
try:
self.encoding = getToolByName(
context, "portal_properties").site_properties.default_charset
except AttributeError:
self.encoding = 'ascii'
registry = getUtility(IRegistry)
self.encoding = registry.get('plone.default_charset', 'ascii')

def __contains__(self, value):
"""Return whether the value is available in this source
Expand Down

0 comments on commit dd443d0

Please sign in to comment.