Commit c3cc9762 authored by Andreas Jung's avatar Andreas Jung

cleanup

parent 10cbabab
......@@ -54,8 +54,8 @@ class Z2UnicodeEncodingConflictResolver:
return unicode(text, encoding, self.mode)
class PreferredCharsetResolver:
""" A resolver that tries uses the HTTP_ACCEPT_CHARSET
header.
""" A resolver that tries use the encoding information
from the HTTP_ACCEPT_CHARSET header.
"""
implements(IUnicodeEncodingConflictResolver)
......@@ -64,7 +64,8 @@ class PreferredCharsetResolver:
request = context.REQUEST
if not hasattr(request, '__zpt_available_charsets'):
charsets = getattr(request, '__zpt_available_charsets', None)
if charsets is None:
charsets = IUserPreferredCharsets(request).getPreferredCharsets()
# add management_page_charset as one fallback
......@@ -78,9 +79,6 @@ class PreferredCharsetResolver:
# cache list of charsets
request.__zpt_available_charsets = charsets
else:
charsets = request.__zpt_available_charsets
for enc in charsets:
try:
return unicode(text, enc)
......
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