From 6e6a384c10e9ba4ac5043320cfa73cb89f5e6af0 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Mon, 7 Jan 2008 16:51:33 +0000
Subject: [PATCH] Fix string encoding

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18623 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/BusinessTemplate.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index 1dcfdd793c..f697065471 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -2335,11 +2335,15 @@ class PortalTypeRolesTemplateItem(BaseTemplateItem):
           'base_category_script'):
         prop_value = role.get(property)
         if prop_value:
+          if isinstance(prop_value, str):
+            prop_value = prop_value.decode('utf-8')
           xml_data += "\n   <property id='%s'>%s</property>" % \
               (property, prop_value)
       # multi
       for property in ('category', 'base_category'):
         for prop_value in role.get(property, []):
+          if isinstance(prop_value, str):
+            prop_value = prop_value.decode('utf-8')
           xml_data += "\n   <multi_property "\
           "id='%s'>%s</multi_property>" % (property, prop_value)
       xml_data += "\n  </role>"
-- 
2.30.9