[Erp5-report] r38884 kazuhiko - in /erp5/trunk/products/ERP5Type: ./ patches/
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Oct 5 12:27:05 CEST 2010
Author: kazuhiko
Date: Tue Oct 5 12:27:02 2010
New Revision: 38884
URL: http://svn.erp5.org?rev=38884&view=rev
Log:
patch PreferredCharsetResolver.resolve so as to handle requests that do not have 'Accept-Charset: UTF-8' header.
Added:
erp5/trunk/products/ERP5Type/patches/unicodeconflictresolver.py
Modified:
erp5/trunk/products/ERP5Type/ZopePatch.py
Modified: erp5/trunk/products/ERP5Type/ZopePatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ZopePatch.py?rev=38884&r1=38883&r2=38884&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] Tue Oct 5 12:27:02 2010
@@ -61,6 +61,7 @@ from Products.ERP5Type.patches import OF
from Products.ERP5Type.patches import make_hidden_input
from Products.ERP5Type.patches import ClientStorage
from Products.ERP5Type.patches import DemoStorage
+from Products.ERP5Type.patches import unicodeconflictresolver
# BACK: Forward Compatibility with Zope 2.12 or CMF 2.2. Remove when we've
# dropped support for older versions.
from Products.ERP5Type.patches import TransactionAddBeforeCommitHook
Added: erp5/trunk/products/ERP5Type/patches/unicodeconflictresolver.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/unicodeconflictresolver.py?rev=38884&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/unicodeconflictresolver.py (added)
+++ erp5/trunk/products/ERP5Type/patches/unicodeconflictresolver.py [utf8] Tue Oct 5 12:27:02 2010
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2002 Zope Foundation and Contributors.
+# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+##############################################################################
+
+try:
+ from Products.PageTemplates.unicodeconflictresolver \
+ import PreferredCharsetResolver
+except ImportError:
+ # do nothing for Zope-2.8
+ pass
+else:
+ def PreferredCharsetResolver_resolve(context, text, expression):
+ # Since we use UTF-8 only in PageTemplate, it is enough here. It is
+ # faster than the original implementation, and it is compatible with
+ # requests that do not contain Accept-Charset header.
+ return unicode(text, 'utf-8')
+ PreferredCharsetResolver.resolve = PreferredCharsetResolver_resolve
More information about the Erp5-report
mailing list