Commit 910d8f17 authored by Jérome Perrin's avatar Jérome Perrin

use ustr to prevent converting unicode to string and getting 'ascii' codec

can't encode character UnicodeErrors


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21143 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fafbf335
...@@ -29,6 +29,7 @@ from Products.Formulator import TALESField ...@@ -29,6 +29,7 @@ from Products.Formulator import TALESField
from Products.Formulator import MethodField from Products.Formulator import MethodField
from ProxyField import ProxyField from ProxyField import ProxyField
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from DocumentTemplate.ustr import ustr
from cgi import escape from cgi import escape
import types import types
from zLOG import LOG from zLOG import LOG
...@@ -638,7 +639,7 @@ def SingleItemsWidget_render_items(self, field, key, value, REQUEST): ...@@ -638,7 +639,7 @@ def SingleItemsWidget_render_items(self, field, key, value, REQUEST):
if item_value == value and not selected_found: if item_value == value and not selected_found:
rendered_item = self.render_selected_item(escape(str(item_text))\ rendered_item = self.render_selected_item(escape(ustr(item_text))\
.replace(' ', ' '), .replace(' ', ' '),
item_value, item_value,
key, key,
...@@ -646,7 +647,7 @@ def SingleItemsWidget_render_items(self, field, key, value, REQUEST): ...@@ -646,7 +647,7 @@ def SingleItemsWidget_render_items(self, field, key, value, REQUEST):
extra_item) extra_item)
selected_found = 1 selected_found = 1
else: else:
rendered_item = self.render_item(escape(str(item_text))\ rendered_item = self.render_item(escape(ustr(item_text))\
.replace(' ', ' '), .replace(' ', ' '),
item_value, item_value,
key, key,
...@@ -695,8 +696,8 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST): ...@@ -695,8 +696,8 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST):
if item_value in value: if item_value in value:
rendered_item = self.render_selected_item( rendered_item = self.render_selected_item(
escape(str(item_text)).replace(' ', ' '), escape(ustr(item_text)).replace(' ', ' '),
escape(str(item_value)), escape(ustr(item_value)),
key, key,
css_class, css_class,
extra_item) extra_item)
...@@ -705,8 +706,8 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST): ...@@ -705,8 +706,8 @@ def MultiItemsWidget_render_items(self, field, key, value, REQUEST):
selected_found[index] = 1 selected_found[index] = 1
else: else:
rendered_item = self.render_item( rendered_item = self.render_item(
escape(str(item_text)).replace(' ', ' '), escape(ustr(item_text)).replace(' ', ' '),
escape(str(item_value)), escape(ustr(item_value)),
key, key,
css_class, css_class,
extra_item) extra_item)
......
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